Forum Discussion
Gerardo_Garcia_
Nimbostratus
May 21, 2008Content Disposition
We have a web application that includes Microsoft Office documents links.
When you click on the document using IE you will see an embedded document in your browser.
We are gettin...
hoolio
Cirrostratus
May 22, 2008I'm not sure what your exact criteria is for rewriting the header. Here is an example that would rewrite every Content-Disposition header if it's present in the response:
when HTTP_RESPONSE {
Check if the response has a Content-Disposition header
if {[HTTP::header exists Content-Disposition]}{
Replace the existing Content-Disposition header
with one that prompts the user to download the content
HTTP::header replace Content-Disposition "attachment; filename="
}
}
I didn't test to see if you have to specify a filename. I doubt you do though. You might also want to limit when the header replacement is done by characteristics of the request or response. If you post an example of the response headers for a response you want to rewrite we might be able to give you more detailed suggestions.
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects