Gayan Fernando
Gayan Fernando

Reputation: 591

Current location of uploading file not correct for Laravel getRealPath()

There is an issue on following code which gives the wrong location for large size (Greater than 1Mb) files.

$file = $request->file('file');
echo $file->getRealPath();

Above code gives me the output for large files is "/var/www/xxxx/public" which is not expected. But for small size files it is something like "/tmp/phpC6PcYz" which is expected.

What could be the issue? It appears to be some server configuration such as memory limit. I increased PHP memory limit up to 1Gb and still have the issue.

Upvotes: 0

Views: 199

Answers (1)

Moshe Fortgang
Moshe Fortgang

Reputation: 1150

maybe you also need to define upload_max_filesize

Upvotes: 1

Related Questions