[英]laravel file upload - The "" file does not exist or is not readable
When I am uploading a file above 5mb I get the following error,当我上传超过 5mb 的文件时,出现以下错误,
The "" file does not exist or is not readable. "" 文件不存在或不可读。
This only happens once file sizes creep up towards 5mb, I cannot understand why this would be a problem, below is my code,这只发生在文件大小接近 5mb 时,我不明白为什么这会是一个问题,下面是我的代码,
public function verifySave(Request $request)
{
$path = Storage::disk('local')->put('verification', $request->file('certificate'));
//$path = $request->file('certificate')->putFileAs('verification');
$newPath = \Storage::disk('local')->path($path);
if(strpos($request->file('certificate')->getMimeType(), "image") !== false) {
$pdf = new Fpdf();
$pdf->AddPage();
$pdf->Image($newPath, 0, 0, -300);
$newPath = \Storage::disk('local')->path('verification/' . $request->file('certificate')->hashName() . '.pdf');
$pdf->Output('F', $newPath);
}
$verification = [
'death_certificate' => $newPath,
'uploaded' => 'Yes',
'method' => $request->input('verify_method')
];
$request->session()->put('verification', $verification);
return redirect('/your-details');
}
If someone else gets this error and it doesn't turn out to be a permissions issue, check your php.ini...make sure that your upload_max_filesize is as big as your post_max_size.如果其他人收到此错误并且结果不是权限问题,请检查您的 php.ini...确保您的 upload_max_filesize 与您的 post_max_size 一样大。 I had 1000M for post_max_size (we deal with some big ol' video files), but only 100M for upload_max_size (I blame my old eyes).我有 1000M 的 post_max_size(我们处理一些大的视频文件),但只有 100M 的 upload_max_size(我责怪我的老眼睛)。 The upload would churn for a long time, and then throw the error above.上传会搅动很长时间,然后抛出上面的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.