i am developing a preview function where i want to view objects from my s3 aws bucket. i get this url: https://[BUCKET NAME].s3.us-east-2.amazonaws.com/[FILE NAME].[EXTENTION] and when i open it the file automatically starts to download whereas i just want to view the file not download it as an attachment.
i have tried google viewer url: https://docs.google.com/viewerng/viewer?url=https://[BUCKET NAME].s3.us-east-2.amazonaws.com/[FILE NAME].[EXTENTION]&chrome=false . it works fine but i was asked specifically to find a way to view thru aws url as the google viewer at times is not loading fast and also leaves the screen blank for a long time.
2
Answers
Here is some server side set up need to required.
While upload file into AWS S3 Bucket set below configuration.
In Spring Boot Java
It Depands upon extension of the file you try to access via url. extension with img and mp4 can easily view in webpage without any confusion. if you want to access file with other extension like html,css,javascript you can try using static-web-hosting in s3.