New user: S3 request returning file of different name?



Hi guys,
I’m interested in doing the following with S3 storage:
If i request:
I get a mp3 file named: “spades.mp3”

Is it possible to return a file name that is different to the pointer in the url?
Assuming 12345 is a unique reference, how would I go implementing this?

(Should I store the files in S3 by the end file name, eg “spades.mp3” or should I store the file with the name “12345”? How do I get S3 to deliver it as a different name?)

(I also don’t fully understand MIME types with S3 storage yet.)



You may be able to achieve that by using the Content-Disposition header in DreamObjects response. I see here that the option is available.

You may start learning about it here:

If you write a tutorial on how to do this, you can get free credit from DreamHost. Check


Stefano is correct, you’re looking for the Content-Disposition header. In your example, if you have an object called “12345” you could set the Content-Disposition header to be attachment; filename="spades.mp3" and when someone clicks the link for 12345, that file will be downloaded with the name spades.mp3.

An easy way to set the header is with a client like Cyberduck. You can modify an object’s metadata and add the content-disposition header with your own custom value -