mercredi 27 juillet 2016

Laravel 5.1 using storage to move the file to a public folder

In my Laravel API call, I use Storage to upload a file. Then I wold like to rename and move the file to a public directory by using $dest = '/var/www/public/uploads/';

Storage::disk('local')->put($filename.'.'.$extension,  File::get($file));
$oldfilename = $filename.'.'.$extension;
Storage::move($oldfilename, $dest.$newImageName);

But instead of moving the file to the $dest directory, I get a folder created with the $dest dir name inside my storage/app folder and the file is copied there. I have also tried using double quotes around $dest.$newImageName but no success.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire