What is the name of the domain?
example.com
What is the issue you’re encountering
http://example.com/video.mp4?filename=abc.mp4
, how to make this happen?
example.com
http://example.com/video.mp4?filename=abc.mp4
, how to make this happen?
sorry about the link. I just want to make an example, like
> http://somedomain.com/video.mp4?filename=abc.mp4
when users download, the filename should be abc.mp4.
Hello !
sorry about the link. I just want to make an example, like
when users download, the filename should be abc.mp4.
To further investigate, could you kindly explain regarding your expectation ?
Are you trying to modify the response header ? If yes, kindly review this document that might be related :
Thank you !
So you want to capture value from filename
query string (i.e. abc.mp4
from http://somedomain.com/video.mp4?filename=abc.mp4
) and add it to Content-Disposition
response header, correct?
If you wanted to do this with Transform Rules, you would need to parse http.request.uri.query field and extract the filename using functions:
(http.request.full_uri wildcard "http://somedomain.com/*?filename=*")
Content-Disposition
concat("attachment;filename=", substring(http.request.uri.query, 9))
In this example 9
is the number of characters between the beginning of query string and the filename itself, i.e. filename=
is 9 characters. This will work if your query string structure is permanently consistent, i.e. you expect clients to always request filename=
and never something_else_first=123&filename=
.
If you need to parse query string parts and dynamically fill the header to account for various different ways users might send query strings, I’d suggest to define such rule via JavaScript using Snippets instead. Here is an example to get you started.