Cannot download non-image media files, original filenames lost when uploaded to S3

Looking at this again, I think the solution is the other way around – the uploads:migrate_to_s3 task should be if !FileHelper.is_supported_media?(name). It doesn’t make sense to put the content-disposition: attachment; filename=X header on videos and audio. You are streaming those files from within a Discourse post, not downloading them?

So what we would want is:

No content-disposition attachment header

  • Image
  • Video
  • Audio

Yes content-disposition attachment header with original filename

  • All other attachments/uploads (PDF, TXT, CSV, etc.)

If I’m not seeing something here please feel free to add more information / examples.

3 Likes