Skip to content
Advertisement

Amazon S3 upload file and get URL

Is it possible to upload a txt/pdf/png file to Amazon S3 in a single action, and get the uploaded file URL as the response?

If so, is AWS Java SDK the right library that I need to add in my java struts2 web application?

Please suggest me a solution for this.

Advertisement

Answer

To make the file public before uploading you can use the #withCannedAcl method of PutObjectRequest:

JavaScript
Advertisement