Feature request: set "filename" directive of Content-Disposition header for Download Videos (Beta)

Follow-up to this post:

It would be great if we could set the filename directive of the Content-Disposition header, in order to customize the filename of the downloaded file when generating download links for users. As of right now, it seems that the filename is always default.mp4, which is not ideal when trying to provide downloads as part of a branded experience.

Ideally developers could include an optional filename parameter when POSTing the create downloads endpoint to customize the filename of the generated file.

1 Like

This is a great idea! I would expand it further and say maybe it should even be a query parameter in the request (such as .../default.mp4?filename=coolvideo.mp4) so you can determine the value for this in the frontend application if you wanted to.

1 Like

Yep, that could work too!

The only thing I worry about with a query parameter is potential for abuse, but that’s somewhat far-fetched. I guess if someone created a public download link with no signing token then attackers could… change the name of the downloaded video file to mislead end-users? Seems like a limited attack vector.

This seems like it would be a simple change, especially implementing it as a query param. How soon do you think you guys could put this feature live?

You can now specify the filename Stream will send in the content-disposition header as a query parameter!
Example: https://videodelivery.net/5d5bc37ffcf54c9b82e996823bffbb81/downloads/default.mp4?filename=example-name. This will download a file called example-name.mp4 to your computer.

There are a few caveats on what you can give as a filename. You can use up to 120 characters and have to choose the filename from these characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_. Otherwise the link will return a helpful error.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

Just used this feature and it brought me so much joy! Thanks for posting about it @weaver!