we are setting up a website that hosts mp3 files on spaces. We want it in such way that if the visitor clicks download, the mp3 doesn’t have to open a player. We want instant download

how do we achieve this with spaces?

sample link
https://spacename.sfo2.digitaloceanspaces.com/filename.mp3

with dropbox i could easily add &dl=1

how does it work with spaces?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

What you could do is modify the metadata of the file and set the Content-Disposition which indicates if a regular file should be displayed inline in the web browser or downloaded as an attachment. For more information you could take a look at the official documentation here:

https://www.digitalocean.com/docs/spaces/how-to/set-file-metadata/

Hope that this helps!
Regards,
Bobby

Submit an Answer