Home > other >  failed to open stream : no such file or directory in laravel
failed to open stream : no such file or directory in laravel

Time:02-10

I am trying to upload images in to database, but getting error of failed to open stream : no such file or directory. But when i am uploading images in App/http/controller inside the directory then it is possible to upload image, but when uploading in App/Import controller file then getting this error. What is a good process to quickly find the solution? i m going this way :

 $filenamewithextension = $image->getClientOriginalName();
 $filename = pathinfo($filenamewithextension, PATHINFO_FILENAME);
 $extension =  getClientOriginalExtension($image);
 $filenametostore = $filename . '_' . time() . '.' . $extension;
 $filePath = 'direcory/' . $image;
 Storage::disk('s3')->put($filePath, fopen($image, 'r '), 'public');

enter image description here

CodePudding user response:

  •  Tags:  
  • Related