How to upload a file to Amazon S3 and get the url in response using iOS

Question:

I have used the code snippet from Amazon Sample Code. The below code uploads the data into amazon S3 bucket, but I need the URL of the upload file. Am i going in the right direction? or could someone point me the mistake I am making

Any kind of help would be greatly appreciated.


bfTask Response:

Answer:

If you just need to download the file, you can use AWSS3TransferManagerDownloadRequest to download a file using the SDK. Alternatively, you can use AWSS3PreSignedURLBuilder to generate a pre-signed URL to download a file.

If you just want to know the URL of the object, the URL follows the following pattern:

Any objects in Amazon S3 are private by default and not publicly readable. If you want to make it publicly readable, you need to set ACL on your AWSS3TransferManagerUploadRequest object.

See Amazon S3 Bucket Public Access Considerations for more details.

Leave a Reply