Question

How can I upload file directly to S3 using curl

My current flow is:

  1. Service A makes a request to my application with a file name
  2. My appln generates an S3 federated user and returns the client the session, access key and security key
  3. Now the service A will directly upload the file to S3 bucket with the session details. This has to be done with curl library
  4. Finally notify once S3 once upload is completed.

I am yet to identify how the step 3 need to be implemented. I have given CreateObject permission the federated user. But the upload is failing. I am trying to make the service run independent of the logic I am running behind and without knowledge

Any help will be appreciated. Looks like a silly mistake i am doing here.

Was it helpful?

Solution

What kind of error do you receive (take a look at downloaded file) ? Most likely you incorrectly sign outgoing request. Please take a look at this document: Signing and Authenticating REST Requests.

I would also recommend you to carefully read Amazon S3 REST API to understand how you should operate with S3 buckets / objects.

Hope it helps you !

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top