--

Thanks bro. It was much helpful :) <3.

Note for the future readers:

1) AmazonS3Client is now deprecated. So, the above highlighted line should be changed to this.amazonS3 = AmazonS3ClientBuilder.standard().withRegion(s3Region).withCredentials(new AWSStaticCredentialsProvider(credentials)).build();

where s3Region is your region name as a string.

2) The line where the fileURL is formed should be moved below the "uploadFileToBucket" method call, otherwise it will return the fileURL as if the file has been uploaded, even in the cases where the file hasn't actually been uploaded due to an error occured in "uploadFileToBucket".

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Pavindu Lakshan
Pavindu Lakshan

Written by Pavindu Lakshan

Software Engineer at WSO2 | Tech Blogger | Open-source Enthusiast - Views and opinions are strictly my own

No responses yet

Write a response