I want to upload a photo with item (which here is a book) that i'm creating.
It worked perfectly on localhost but when I uploaded it on a shared host it stopped working.
I user Intervention package and here is my code :
.
$orgName = $request->file('img')->getClientOriginalName();
$path = public_path('img/'.$orgName);
$paths = "";
if(file_exists($path)){
$orgName = str_random(20).$orgName;
$path = public_path('img/'.$orgName);
Image::make($request->file('img'))->fit(320,150)->save($path);
$paths.='img/'.$request->name.'/'.$orgName."_&_";
}
else{
$path = public_path('img/'.$orgName);
Image::make($request->file('img'))->fit(320,150)->save($path);
$paths.='img/'.$request->name.'/'.$orgName."_&_";
}
$book->img=$paths;
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2a9Mo1W
via IFTTT
Aucun commentaire:
Enregistrer un commentaire