【发布时间】:2017-09-29 07:44:19
【问题描述】:
我正在尝试使用干预图像插件在 laravel 中上传
但是得到这个错误。抱歉 4 英语不好
无法将图像数据写入路径 (E:\xampp\htdocs\my-project\storage\app/medicines/thumbs/medicines/MEmheIamxDfu8ePa1h5mtovKFzY0POJtfGW8BLYZ.jpeg)
if($request->hasFile('photo')) {
$photo = $request->file('photo');
$image = $photo->store('medicines');
$path = storage_path('app/') .$image ;
Image::make($path)->resize(75,75)->save(storage_path('app/medicines/thumbs/'.$image,50));
【问题讨论】:
-
只需将
/替换为 Windows 的 \ ;) -
在哪里?哪一行?
-
storage_path('app/')==>storage_path('app\')和这里storage_path('app/medicines/thumbs/'.$image,50)==>storage_path('app\medicines\thumbs\'.$image,50) -
对不起换成双一\\!!
-
它对你有用吗??
标签: laravel