S3 View File Instead - Of Download [new]
You can change these settings for existing files or set them during upload using several methods. 1. Using the AWS Management Console For a quick manual fix on a single file:
: This header explicitly instructs the browser whether to show the file inline (view) or as an attachment (download). To View : Set to inline . To Download : Set to attachment . How to Update S3 Metadata s3 view file instead of download
: This tells the browser what kind of file it is (e.g., image/png , application/pdf , or video/mp4 ). Without a specific type, the browser cannot render the file and will default to downloading it. You can change these settings for existing files
The behavior of a file in a web browser is primarily determined by these metadata fields: To View : Set to inline
To make Amazon S3 files viewable in a browser instead of forcing a download, you must correctly configure two specific HTTP headers: and Content-Disposition . By default, S3 may assign a generic "binary/octet-stream" type which triggers a download. Key Headers for Browser Viewing