Ad

Current Location Of Uploading File Not Correct For Laravel GetRealPath()

- 1 answer

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.

Ad

Answer

maybe you also need to define upload_max_filesize

Ad
source: stackoverflow.com
Ad