系统:mac
php环境:MAMP
php框架:laravel
当我使用表单上传时,发现上传上来的缓存文件是不可读的。
echo substr(sprintf("%o", fileperms($this->photo->path())), -4); // 结果为0600
而我系统缓存目录的权限是777,现在我就无法使用laravelUploadedFile实例来处理上传文件,因为一旦使用
$request->photo->store('photos')就会弹出权限不够错误。错误如下:
[2018-01-09 17:22:57] local.ERROR: Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException: The file /Applications/MAMP/tmp/php/phpUulx0L could not be accessed in /Users/pan/code/wechat/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php:125
Stack trace:
#0 /Users/pan/code/wechat/vendor/symfony/http-foundation/File/File.php(79): Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser->guess('/Applications/M...')
#1 /Users/pan/code/wechat/vendor/symfony/http-foundation/File/File.php(58): Symfony\Component\HttpFoundation\File\File->getMimeType()
求救!