为什么存储:删除不在laravel 5.5上工作

时间:2018-05-08 18:44:57

标签: php laravel laravel-5 eloquent delete-file

控制器上的

use Storage;

$postroute_ori=/images/120_5.JPG;
// Delete a single file
File::delete($postroute_ori);    <---"/images/120_5.JPG"   not work

$delfile='/public'.$postroute_ori;
dump($delfile);                  
Storage::delete($delfile);       <---"/public/images/120_5.JPG"  not work

$image_path = public_path().$postroute_ori; 
dump($image_path);
unlink($image_path);     <--"D:\AppServ\www\codo\public/images/120_5.JPG" work well

$image_path = public_path().$postroute_ori; 
dump($image_path);
Storage::delete($image_path);  <--"D:\AppServ\www\codo\public/images/120_5.JPG" not work


other method like 
use file;
file::delete($filename)     <----not work

只有php方法unlink工作得很好〜 如何正确使用laravel storege方法?

0 个答案:

没有答案