Welcome! Log In Create A New Profile

Advanced

URL decoding a variable and/or using rewite effectively

November 22, 2011 12:10PM
Thank you in advance to anyone who can point me in the right direction.

We currently use nginx as an asset server. Requests are made to the asset server in the form of:
http://downloads.ourdomain.com?unique_key=MD5hashOFstuff&name=the_nice_file_name(that might have quotes or spaces)

The unique key is the actual name of the file, however we use $arg_NAME in the headers to control the downloaded name. eg:
add_header Content-Disposition "attachment;filename=$arg_NAME.xslx";
(yes they are excel files).

Our current issue is that space, parenthesis and other characters become URL encoded in the variable. As such, the file-name (as it appears in download) is not quite what we would like. My research has led me to find that there is currently no access to a 'url-decode' style function. I was curious, though, if there might be another method someone could think to employ. Perhaps I have access to regular expression replace style functionality that I am unaware of. Something that simple, would more then likely solve all of the issues for this particular case.

Thank you for taking the time to read this,

-Mike
(kung_fu_mike)
Subject Author Posted

URL decoding a variable and/or using rewite effectively

kung_fu_mike November 22, 2011 12:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 55
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready