Re: Upload to AWS S3

See all posts Reply

Re: Upload to AWS S3 new!
by Daniel, 10 years, 5 months ago
I try to upload to Amazone S3, with different "resize" Images.

Is there a way to uploaded direct?

For example:
// IMAGE CONVERTED
$newImg = $handle->Process(); 
if ($handle->processed) {
  $s3->putObjectFile(S3::inputFile($newImg), BUCKET_NAME, 
    $handle->file_dst_name, S3::ACL_PUBLIC_READ, array(), 
    array("Content-Type" => 'image/jpeg'));
}

and so on with the other resize options.

Is there a way to get the NEW (edited) $_FILES['file_img']['temp_name'] and to put this in $s3->putObjectFile() for each image?Reply
Re: Upload to AWS S3 new!
by colin, 10 years, 5 months ago
I am not too sure what you mean. You cannot change $_FILES anyway, so the way you do it is fine: you process the image, and then upload it to S3.Reply
Re: Upload to AWS S3 new!
by Hansajith, 1 year, 7 months ago
This works...

$return_content = $handle->process();
 if ($handle->processed) {
  Storage::put($path . $handle->file_dst_name, $return_content);
  $handle->clean();
  return $handle->file_dst_name;
} else {
  throw new Error("Error Processing Request", $handle->error);
}
Reply