1

I'm using the javascript SDK for AWS s3. I'm attempting to upload a file to my bucket and right after that, getting that file data from S3. So i'm facing two issues :

I need to execute synchronously two functions. One for uploading and another to fetch the file's data. I am using the Client javascript SDK for aws S3 and i don't know how to be sure to have all files fully uploaded before starting to fetch them in the bucket.

Also, the object data does not show the url of the file , so i don't know how to get it.

Please any help would be appreciated.

John doe
  • 3,680
  • 7
  • 31
  • 65
  • Check this it will be helpful http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/transfer/TransferManager.html – Piyush Patil Jun 07 '16 at 15:59
  • @error2007s - those look like the docs for Amazon's *Java* sdk. OP's referring to the *JavaScript* sdk. ---- Anyway, John Doe - aren't there examples in AWS docs for querying S3? What are you missing? – Don Cheadle Jun 07 '16 at 16:15
  • http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property and http://stackoverflow.com/questions/27299139/read-file-from-aws-s3-bucket-using-node-fs – Don Cheadle Jun 07 '16 at 16:18
  • You don't need the URL of the object to retrieve it -- just supply the same bucket/key to the JavaScript SDK getObject() function. You can do that some time after the putObject() completes. But if you do want the URL then you can create it from the bucket/key (see https://stackoverflow.com/questions/7933458/url-to-get-a-file-from-amazon-s3). PS why do you need to get the file immediately after uploading it (you presumably already have it)? – jarmod Oct 27 '17 at 00:37

0 Answers0