How can I force a PDF download with Platform.sh?
Chris Yates
I’d like to force a PDF download from my static site, rather than have that PDF open in a browser. With Apache, I’d do it like so:
<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
How do I do that with Platform.sh?
0
Comments
You can set headers for static files in your
.platform.app.yamlfile.In this specific case, you would include something like this:
See the documentation for further examples.
For files served through your application rather than statically you would need to set the same headers from your application code.
Please sign in to leave a comment.