【发布时间】:2020-12-10 15:42:09
【问题描述】:
我在将大小约为 400MB 的文件上传到 Laravel 的外部磁盘时遇到问题。 在本地磁盘上存储上传的文件没有问题,但是当它需要上传到 S3 磁盘时,我收到以下错误:
ErrorException: fwrite(): Unable to create temporary file, Check permissions in temporary files directory.
使用以下代码(没有错误):
$contents = file_get_contents($file);
$local = \Storage::disk('local');
$local->put($desitinationUrl, $contents);
但是当发生以下情况时,我得到一个错误
$uploadedfile = \Storage::disk('local')->get($destinationUrl);
$s3 = \Storage::disk('s3');
$s3->put($destinationUrl, $uploadedfile);
有人知道问题出在哪里吗? 提前致谢!
【问题讨论】:
-
小文件有同样的问题吗?了解它是否仅发生在某个大小之后或大小无关紧要是非常有用的
-
小文件没问题,通过这种方式我最多可以上传250MB左右,但大于我就会遇到这个问题
标签: laravel amazon-s3 php-7 plesk