I am running a Laravel 5.2 application with PHP 5.5 and nginx on Ubuntu 14.04.
Sometimes it got uploaded successfully without any error, also sometimes out of nowhere it produces this error.
I don't know what the problem is or what is happening. I can't reproduce the error every time. It just happens randomly!
Here is what I've tried (already configured):
php.ini:
post_max_size: 20M
upload_max_filesize: 20M
memory_limit: -1
max_execution_time: 60
max_input_time: 60
nginx configuration:
client_max_body_size 100m;
i don't know how it happen..!!you can try below code and may be help you..!
$bannerimage = $req->file('uploadusers');
if($bannerimage!='')
{
$destination = 'public/uploadimage/';
$newname = str_random(5);
$ext = $bannerimage->getClientOriginalExtension();
$filename = $newname.'-original.'.$ext;
$newFilename = $newname.'.'.$ext;
if($bannerimage->move($destination, $filename))
{
copy($destination . $filename, $destination . $newFilename);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.