fix: preserve original file extension on asset downloads (#41)#43
Merged
Merged
Conversation
Downloads were saving as "Video_Title" instead of "Video_Title.mp4"
because the API passed asset.name (human-readable, no extension) as the
Content-Disposition filename, and the dashboard overrode it further via
a.download.
Backend: new build_download_filename() helper derives the extension
from MediaFile.original_filename (authoritative) or the S3 key, and
appends it to asset.name when missing. Used by /assets/{id}/stream and
/share/{token}/stream/{asset_id}.
Frontend: the dashboard Download button now calls /stream?download=true
and uses a hidden iframe instead of setting a.download. folder-share-
viewer no longer overrides a.download so the browser honors the
server's Content-Disposition filename.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41
Summary
Video_Titleinstead ofVideo_Title.mp4because the API passedasset.name(no extension) as theContent-Dispositionfilename, and the dashboard further overrode it viaa.download.build_download_filename()helper derives the extension fromMediaFile.original_filename(authoritative) or the S3 key, and appends it toasset.namewhen missing (case-insensitive). Applied in/assets/{id}/streamand/share/{token}/stream/{asset_id}./stream?download=trueand uses a hidden iframe instead of settinga.download.folder-share-viewerno longer overridesa.downloadso the browser honors the server'sContent-Dispositionfilename.Test plan
.mp4(or original) extensionnamealready includes the extension (e.g.clip.mp4) don't get it duplicated (clip.mp4.mp4)🤖 Generated with Claude Code