First, I'm sorry for my bad English.
I want to upload a file/image from my driver to my project directory using class Storage
. I want that every file/image will be uploaded/moved to my public/img
directory. I use Form::file('img')
on my views and on my post controller, I write this
$img = Input::file('img');
if ($img !== null) {
$filename = $img->getClientOriginalName();
Storage::disk('uploads')->put('filename', $filename);
$jenis->img = $filename;
}
and on my config/filesystem
I write this
'uploads' => [
'driver' => 'local',
'root' => public_path() . '/img',
],
But, nothing happen on my public/img
directory, no new file/image on there. Can u help me whats wrong with my code? and I hope u guys can help me with another good way on how to upload a file/image in laravel
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1ZcyAUe
via IFTTT
Aucun commentaire:
Enregistrer un commentaire