# A bug when files were migrated to S3

**URL:** https://meta.discourse.org/t/a-bug-when-files-were-migrated-to-s3/346954
**Category:** Bug
**Tags:** s3
**Created:** [January 13, 2025, 10:57pm UTC](https://meta.discourse.org/t/a-bug-when-files-were-migrated-to-s3/346954 "2025-01-13T22:57:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [January 13, 2025, 10:57pm UTC](https://meta.discourse.org/t/a-bug-when-files-were-migrated-to-s3/346954/1 "2025-01-13T22:57:30Z")

</div>

> [@Cannot download non-image media files, original filenames lost when uploaded to S3](https://meta.discourse.org/t/cannot-download-non-image-media-files-original-filenames-lost-when-uploaded-to-s3/152797/7):
>
> ### Files which were migrated to S3
> 
> When uploads are migrated from local storage to S3 using the `uploads:migrate_to_s3` two things happen:
> 
> - `content-disposition: attachment; filename=X` is set for all uploads _except_ for images
> - direct local links `[dl_link](https://discourse.forum.tld/uploads/default/original/3X/0/1/0123..sha1.mp3)` in raw posts are replaced with S3 links `[dl_link](https://cdn_url/uploads/original/3X/0/1/0123..sha1.mp3)`
> 
> This mimics the locally hosted uploads in every way (download links with original filenames as well as oneboxing).

I encountered a problem that is the opposite of what is described in this content.In fact，all files, including images, have the `Content-Disposition` set to `attachment`, causing the files to be downloaded.
