Enable file download

File download (for image, PDF and others) from a site is limited by same origin policy. Since DatoCMS’s hostname is always different from the site’s hostname, adding “download” attribute to an anchor element (<a>) doesn’t actually prompt the file to be downloaded on the user’s device when clicked, but instead loads it in the current window.
This limitation can be overcome if the server hosting the file sends the “Content-Disposition” HTTP header with the value “attachment”.
Is there a possibility to set HTTP headers for certain requests in DatoCMS?

hey @p7s1p4atv thank you for your request and welcome to Community!

Regarding your question, if you have custom requirements I would recommend you to proxy the requests from your server so that you can do all the custom headers that you require, what do you think?

Hey, thanks for your reply.
We are using serverless architecture (as is probably the case with most of DatoCMS users). We use Netlify to serve the static files. Even though Netlify has some proxy capabilities, it doesn’t allow for custom response headers.
Additionally, proxying large files would put a duplicate traffic (and optionally cache storage) burden on the server if there was one.