Menu

Fix Presigned Object Storage Export Filenames and Content-Type
📰

Fix Presigned Object Storage Export Filenames and Content-Type

DEV Community: go·finnmorgan226·10 days ago
#QpO0jEOE
#devtogo#devto#dev#object#storage
Reading 0:00
15s threshold

Short answer: keep every tenant export private, set the object's Content-Type and Content-Disposition metadata before issuing a fresh presigned download link, and verify that metadata with a HEAD request before handing the URL to a browser.

For a developer tool that stores product images and generates tenant-scoped PDF or CSV exports, this is an access-control decision before it is a browser quirk. A signed link authorizes one object for a bounded period; it should not be asked to repair metadata that was wrong when the export was written. My operational recommendation is to make metadata validation a release condition for the export job, then sign only the validated object. This keeps the failure domain small and gives the service an observable checkpoint instead of leaving users to report that a file opened in a tab with an opaque name.

Compare browser symptoms with stored object state

The browser has three inputs that matter here: the URL, the stored media type, and the stored content disposition.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.