Forum Discussion
Marc_13733
Nimbostratus
Feb 16, 2010Change Content Disposition from Inline to Attachment
Our DMS server returns only inline disposition headers:
Content-Disposition: inline; filename=somefile.pdf
We need to replace this header with the following:
Content-Disposition...
Marc_13733
Nimbostratus
Feb 16, 2010Thanks Aaron, works perfectly!
One more thing - we want this modification to only occur when the querystring contains the word "attachment". When we do this:
when HTTP_RESPONSE {
set querystring URI::query
if { $querystring contains "attachment=1" } {
HTTP::header replace Content-Disposition [string map -nocase "inline attachment" [HTTP::header Content-Disposition]]
}
}
We get an error "command is not valid in current event context". Apparently we can't query the querystring in a HTTP_RESPONSE block. How else can we do this header modification based on the URI?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
