简体   繁体   English

laravel 文件上传 - "" 文件不存在或不可读

[英]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.

相关问题 laravel 文件上传会引发错误“文件不存在或不可读”。 - laravel file upload throws an error “file does not exist or is not readable.” laravel 文件不存在或不可读 - laravel file does not exist or is not readable 无法上传 Laravel 中的图像:““C:\xampp\tmp\php38A9.tmp“文件不存在或不可读。” - Unable to upload image in Laravel: “The ”C:\xampp\tmp\php38A9.tmp“ file does not exist or is not readable.” Laravel 文件不存在 - 文件上传 - Laravel file does not exist - file upload 如何解决此 Laravel 问题 - “/tmp/phpY14gRo”文件不存在或不可读? - How to resolve this Laravel issue - The “/tmp/phpY14gRo” file does not exist or is not readable? "message": "关键路径 \\"file:///app/storage/oauth-private.key\\" 在 Laravel 6 中不存在或不可读" - "message": "Key path \"file:///app/storage/oauth-private.key\" does not exist or is not readable" in Laravel 6 Laravel生产:文件“ /home/forge/default/storage/app/geoip.mmdb”不存在或不可读 - Laravel production: The file “/home/forge/default/storage/app/geoip.mmdb” does not exist or is not readable 当图像已上传到文件夹中时,如何解决 laravel 中的“文件不存在或不可读” - how to solve “file does not exist or is not readable” in laravel while the image have been uploaded in folder 文件在Laravel中不可读 - File not readable in Laravel 文件上传不起作用Laravel - File upload does not work Laravel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM