mardi 8 mai 2018

Why storege:delete not working on laravel 5.5

on Controller

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

Only the php method unlink work well~ How can I use the laravel storege method correctly?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire