Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to upload to S3 directly from URL using POST?

I know there is a way to upload to S3 directly from the web browser using POST without the files going to your backend server. But is there a way to do it from URL instead of web browser.

Example, upload a file that resides at http://example.com/dude.jpg directly to S3 using post. I mean I don't want to download the asset to my server then upload it to S3. I just want to make a POST request to S3 and it uploads it automatically.

like image 727
user965363 Avatar asked Sep 28 '11 16:09

user965363


People also ask

How do I get my S3 upload URL?

You can get the resource URL either by calling getResourceUrl or getUrl . AmazonS3Client s3Client = (AmazonS3Client)AmazonS3ClientBuilder. defaultClient(); s3Client. putObject(new PutObjectRequest("your-bucket", "some-path/some-key.

How many ways you can upload data to S3?

There are three ways in which you can upload a file to amazon S3.

Which method can be used to upload objects to an S3 bucket?

To upload folders and files to an S3 bucketSign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to upload your folders or files to. Choose Upload.

How do I upload files to Amazon S3?

In the Amazon S3 console, choose the bucket where you want to upload an object, choose Upload, and then choose Add Files. In the file selection dialog box, find the file that you want to upload, choose it, choose Open, and then choose Start Upload. You can watch the progress of the upload in the Transfer pane.


2 Answers

It sounds like you want S3 itself to download the file from a remote server where you only pass the URL of the resource to S3.

This is not currently supported by S3.

It needs an API client to actually transfer the content of the object to S3.

like image 136
Eric Hammond Avatar answered Sep 22 '22 16:09

Eric Hammond


I found this article with some details. You will probably have to modify your buckets' security settings in some fashion to allow this type of interaction.

http://aws.amazon.com/articles/1434

There will be some security issues on the client as well since you never want your keys publicly accessible

like image 38
Matt Avatar answered Sep 22 '22 16:09

Matt