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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1149
Download (untitled) / with headers
text/plain 1.1k
$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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-2538-1239910312-844.45011-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 317
Download (untitled) / with headers
text/plain 317b
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?
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-2538-1239910312-844.45011-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
References: <rt-3.6.HEAD-2538-1239910312-844.45011-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1240058026-2324-46"
Message-ID: <rt-3.6.HEAD-2324-1240058026-152.45011-0-0 [...] rt.cpan.org>
From: hsw [...] rambler.ru
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 511
Download (untitled) / with headers
text/plain 511b
Чтв. Апр. 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' );
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: multipart/mixed; boundary="----------=_1240058026-2324-45"
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/plain; name="тест.txt"
Content-Disposition: inline; filename="тест.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 18
Download тест.txt
text/plain 18b
тест is test.
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1240057730-2324-40"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: application/octet-stream; name="upload.cgi"
Content-Disposition: inline; filename="upload.cgi"
Content-Transfer-Encoding: base64
Content-Length: 685
Download upload.cgi
application/octet-stream 685b

Message body not shown because it is not plain text.

MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-2538-1239910312-844.45011-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-2538-1239910312-844.45011-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-4108-1242073547-813.45011-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 441
Download (untitled) / with headers
text/plain 441b
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...
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-4108-1242073547-813.45011-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-2538-1239910312-844.45011-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4108-1242073547-813.45011-0-0 [...] rt.cpan.org>
Message-ID: <rt-3.6.HEAD-4108-1242107325-1969.45011-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: hsw [...] rambler.ru
X-RT-Original-Encoding: utf-8
Content-Length: 549
Download (untitled) / with headers
text/plain 549b
Пнд. Май 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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-17651-1243688531-1842.45011-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 141
Download (untitled) / with headers
text/plain 141b
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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.