Setting a download filename on S3

One helpful feature of S3, and something I haven’t seen discussed, is that you can use the Content-Disposition header to control the filename of the download a user receives. This is really helpful for when you have a file on S3 named using, say, a hash of the contents. Your user probably doesn’t want a file called “” right?

Here’s an example using boto:

Pretty cool.