I have a simple site setup with virtual directories pointing to Document directories in order to publish documents. What I would like to do is to ensure that any of the files that are accessed, do not try to load in their native format, but instead prompt the user to open or save the file. I have tried adding a custom HTTP response header (from the UI), but must have the syntax wrong, because it isn't working. Even if the header did work, I can't add a custom header for every single file that is published, as they will change often and there will be many. So I need to know how to do this dynamically as well.
I tried adding the header using the following syntax:
content-disposition: attachment; filename=test.txt
Just to be thorough, I should add that I have removed the execute permissions, in order to keep things like .exes from trying to run instead of download.