sheena2994

Untitled

Jun 9th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. //store file input in a varaible
  2. $file = Input::file('image');
  3.  
  4. //Retrieving The Extension Of An Uploaded File
  5. $extension = $file->getClientOriginalExtension();
  6.  
  7. //define directory to store images
  8. $directory = public_path().'/uploads/images';
  9.  
  10. //Move the uploaded file to temp directory
  11. $s3 = AWS::get('s3');
  12.  
  13. $upload_success = $s3->putObject([
  14. 'ACL' => 'public-read',
  15. 'Bucket' => 'styleblink',
  16. 'Key' => $directory,
  17. 'Body' => fopen($file->getPathname(), 'r'),
  18. ]);
Add Comment
Please, Sign In to add comment