in reply to Unable to get filename with quotes after upload?
As an anonymous monk commented, you should be able to do:
$form->{filename}->asStringBut... emphasis on the word should. It doesn't work with your example. Firefox is correctly escaping the filename, but CGI.pm is not correctly dealing with the escaped quote.
On the version of CGI.pm on my system (3.49) the broken filename parsing code is on line 3577. It should be relatively easy to fix.
my ($filename) = $header{'Content-Disposition'} =~/ filename=(("[^"]*")|([a-z\d!\#'\*\+,\.^_\`\{\}\|\~]*))/i;
Maybe something like...
my ($filename) = $header{'Content-Disposition'} =~/ filename=(("(?:\\\"|[^"])*")|([a-z\d!\#'\*\+,\.^_\`\{\}\|\~]*) +)/i;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unable to get filename with quotes after upload?
by isync (Hermit) on Jan 16, 2012 at 15:57 UTC |