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 Updates
APA

Stefan Judis | Sciencx (2020-07-04T22:00:00+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 ,<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 ]. 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 . 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: ]
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/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.