Skip Menu |

This queue is for tickets about the CGI-Simple CPAN distribution.

Report information
The Basics
Id: 45011
Status: open
Priority: 0/
Queue: CGI-Simple

People
Owner: Nobody in particular
Requestors: hsw [...] rambler.ru
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.108
Fixed in: (no value)



Subject: Upload file with unicode filename
$CGI::Simple::PARAM_UTF8 = 1; $CGI::Simple::DISABLE_UPLOADS = 0; my $q = CGI::Simple->new(); $q->charset('utf-8'); Now upload file from IE7 and dump $q: 'avatar' => [ "C:\\Documents and Settings\\IETest\\My Documents\\My Pictures\\\x{410}\x{432}\x{430}\x{442}\x{430}\x{440}\x{44b}\\Rocker Girl 1.gif" ], '.filehandles' => { 'C:\\Documents and Settings\\IETest\\My Documents\\My Pictures\\\xd0\x90\xd0\xb2\xd0\xb0\xd1\x82\xd0\xb0\xd1\x80\xd1\x8b\\Rocker Girl 1.gif' => bless( \*IO::File::_GEN_0, 'IO::File' ) }, '.tmpfiles' => { 'C:\\Documents and Settings\\IETest\\My Documents\\My Pictures\\\xd0\x90\xd0\xb2\xd0\xb0\xd1\x82\xd0\xb0\xd1\x80\xd1\x8b\\Rocker Girl 1.gif' => { 'mime' => 'image/gif', 'size' => 4560 } }, '.upload_fields' => { 'avatar' => 'C:\\Documents and Settings\\IETest\\My Documents\\My Pictures\\\xd0\x90\xd0\xb2\xd0\xb0\xd1\x82\xd0\xb0\xd1\x80\xd1\x8b\\Rocker Girl 1.gif' } $q->param('avatar') == "C:\\Documents and Settings\\IETest\\My Documents\\My Pictures\\\x{410}\x{432}\x{430}\x{442}\x{430}\x{440}\x{44b}\\Rocker Girl 1.gif" and $q->upload() from this value return undef.
On Mon Apr 13 16:00:49 2009, hsw@rambler.ru wrote: Show quoted text
> $CGI::Simple::PARAM_UTF8 = 1; > $CGI::Simple::DISABLE_UPLOADS = 0; > > my $q = CGI::Simple->new(); > $q->charset('utf-8'); > > Now upload file from IE7 and dump $q:
I'm afraid I don't have easy access to a Windows box. Do you get the same problem with FireFox?
From: hsw [...] rambler.ru
Чтв. Апр. 16 15:31:52 2009, ANDYA писал: Show quoted text
> > I'm afraid I don't have easy access to a Windows box. Do you get the > same problem with FireFox?
Yes. It dont work in FF3 to. Just upload file with uniode characters. Try "тест.txt" for example. I try to upload it to upload.cgi. $q->param('F') == "\x{442}\x{435}\x{441}\x{442}.txt"; $q->upload("\x{442}\x{435}\x{441}\x{442}.txt") == undef; $q->upload(encode_utf8("\x{442}\x{435}\x{441}\x{442}.txt")) == bless( \*IO::File::_GEN_0, 'IO::File' );
тест is test.
Download upload.cgi
application/octet-stream 685b

Message body not shown because it is not plain text.

16 Nis. 2009 Per., 15:31:52 tarihinde, ANDYA yazdı: Show quoted text
> > I'm afraid I don't have easy access to a Windows box. Do you get the > same problem with > FireFox?
That's not a browser specific problem unfortunately. It's a windows issue (or perl's lack of some features in the core). You need to apply a patch if $^O =~ /MSWin/i See this thread for the workaround: http://perlmonks.org/?node_id=757328 This issue pops up from time to time...
From: hsw [...] rambler.ru
Пнд. Май 11 16:25:47 2009, BURAK писал: Show quoted text
> That's not a browser specific problem unfortunately. It's a windows > issue (or perl's lack of some features in the core). You need to apply > a patch if $^O =~ /MSWin/i See this thread for the workaround:
I use CGI::Simple on FreeBSD and FF3 on Linux. What M$Win? CGI::Simple upload() not work with $PARAM_UTF8=1 on any unicode filenames. Module should store decoded filenames in '.filehandles', '.tmpfiles' and '.upload_fields' or call encode_utf8() on each upload() call. First is better.
This is a real problem. It manifests itself anytime you upload files with non-ASCII filenames. I think HSW suggested a correct way to fix it.