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;
In reply to Re: Unable to get filename with quotes after upload?
by tobyink
in thread Unable to get filename with quotes after upload?
by isync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |