Downloads can be triggered via HTTP headers (#tilPost)

Recently, I had a quick discussion in Contentful’s community Slack about file downloads. The person I was talking to asked if there is a way to add the Content-Disposition header to uploaded assets. Unfortunately, that’s not possibl…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

Recently, I had a quick discussion in Contentful's community Slack about file downloads. The person I was talking to asked if there is a way to add the Content-Disposition header to uploaded assets. Unfortunately, that's not possible, but this header was news to me! ?

After reading the MDN documentation about Content-Disposition I learned that you could trigger the "Save as" dialog in browsers by applying the response header.

Content-Disposition: attachment; filename="cool.html"

Pretty cool!


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate
APA
Stefan Judis | Sciencx (2022-12-02T20:26:49+00:00) » Downloads can be triggered via HTTP headers (#tilPost). Retrieved from https://www.scien.cx/2020/07/04/downloads-can-be-triggered-via-http-headers-tilpost/.
MLA
" » Downloads can be triggered via HTTP headers (#tilPost)." Stefan Judis | Sciencx - Saturday July 4, 2020, https://www.scien.cx/2020/07/04/downloads-can-be-triggered-via-http-headers-tilpost/
HARVARD
Stefan Judis | Sciencx Saturday July 4, 2020 » Downloads can be triggered via HTTP headers (#tilPost)., viewed 2022-12-02T20:26:49+00:00,<https://www.scien.cx/2020/07/04/downloads-can-be-triggered-via-http-headers-tilpost/>
VANCOUVER
Stefan Judis | Sciencx - » Downloads can be triggered via HTTP headers (#tilPost). [Internet]. [Accessed 2022-12-02T20:26:49+00:00]. Available from: https://www.scien.cx/2020/07/04/downloads-can-be-triggered-via-http-headers-tilpost/
CHICAGO
" » Downloads can be triggered via HTTP headers (#tilPost)." Stefan Judis | Sciencx - Accessed 2022-12-02T20:26:49+00:00. https://www.scien.cx/2020/07/04/downloads-can-be-triggered-via-http-headers-tilpost/
IEEE
" » Downloads can be triggered via HTTP headers (#tilPost)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2020/07/04/downloads-can-be-triggered-via-http-headers-tilpost/. [Accessed: 2022-12-02T20:26:49+00:00]
rf:citation
» Downloads can be triggered via HTTP headers (#tilPost) | Stefan Judis | Sciencx | https://www.scien.cx/2020/07/04/downloads-can-be-triggered-via-http-headers-tilpost/ | 2022-12-02T20:26:49+00:00
https://github.com/addpipe/simple-recorderjs-demo