Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 56780
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: j [...] imperial.cc
Cc:
AdminCc:

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



From j [...] imperial.cc Wed Apr 21 08: 01:39 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.912 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
X-Mailer: Microsoft Outlook 14.0
X-Spam-Flag: NO
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Language: en-sg
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0067_01CAE18D.6805F660"
Message-ID: <006601cae14a$59e2b660$0da82320$ [...] imperial.cc>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -9.912
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 6EA472406AB for <cpan-bug+CGI.pm [...] hipster.bestpractical.com>; Wed, 21 Apr 2010 08:01:39 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dFB+kKvsDOYV for <cpan-bug+CGI.pm [...] hipster.bestpractical.com>; Wed, 21 Apr 2010 08:01:33 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 2E243240598 for <bug-CGI.pm [...] rt.cpan.org>; Wed, 21 Apr 2010 08:01:32 -0400 (EDT)
Received: (qmail 26470 invoked by uid 103); 21 Apr 2010 12:01:33 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 21 Apr 2010 12:01:33 -0000
Received: from cpoproxy3-pub.bluehost.com (HELO outbound-mail-313.bluehost.com) (67.222.54.6) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Wed, 21 Apr 2010 05:01:28 -0700
Received: (qmail 8714 invoked by uid 0); 21 Apr 2010 12:01:25 -0000
Received: from unknown (HELO box531.bluehost.com) (74.220.219.131) by cpoproxy3.bluehost.com with SMTP; 21 Apr 2010 12:01:24 -0000
Received: from bb219-74-221-2.singnet.com.sg ([219.74.221.2] helo=JasonT410s) by box531.bluehost.com with esmtpa (Exim 4.69) (envelope-from <j [...] imperial.cc>) id 1O4YcK-0007JV-KD for bug-CGI.pm [...] rt.cpan.org; Wed, 21 Apr 2010 06:01:24 -0600
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=j [...] imperial.cc
Delivered-To: cpan-bug+CGI.pm [...] hipster.bestpractical.com
Subject: Windows 7 and CGI.PM undefined upload handle
Return-Path: <j [...] imperial.cc>
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=imperial.cc; h=Received:From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:X-Mailer:Thread-Index:Content-Language:X-Identified-User; b=bP2KJFoklGNXUqRZpfSwVS1gmnhnvBJtQl7BRkBV+ktg9Fu4aocTPI6AgIGJPfiaTPVEi7X1awEIHOJAJiW4WwhEehzzG/N/xbHK2r3C6xeb9PLtKZzPWpuXBgWYlf0T;
Thread-Index: AQIfL3CUwQ0ZrZh8E+0VRKt7VnqJzg==
X-RT-Mail-Extension: cgi.pm
X-Original-To: cpan-bug+CGI.pm [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Wed, 21 Apr 2010 20:01:12 +0800
X-Spam-Level:
To: <bug-CGI.pm [...] rt.cpan.org>
X-Identified-User: {8816:box531.bluehost.com:imperib0:imperial.cc} {sentby:smtp auth 219.74.221.2 authed with j [...] imperial.cc}
From: "Jason Rose" <j [...] imperial.cc>
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: us-ascii
Content-Length: 2797
Download (untitled) / with headers
text/plain 2.7k
Hi, It appears that CGI.PM has a platform specific issue with Windows 7, possibly only 64-bit version, in that it always gives undefined handle when doing a $query->upload{field_name'}. Observations: . My code works fine on Windows XP 32bit running all Apache and ActivePerl 5.8/5.10 versions laptop dev environment . My code works fine on Linux Apache build running on B luehost.com hosted solution . Key point: the code works, but has issues on Windows 7 64-bit unless you downgrade to ~v3.25 (I discovered this when rebuilding my dev environment) Potentially useful information (from local dev Win7-64 evironment using 3.48 and 3.49 CGI.PM) . Tried multiple versions of Apache 2.x - no versions worked. . Tried multiple versions of 5.8/5.10 ActiveState PERL (both 32-bit and 64-bit versions) - no versions worked . $ENV{CONTENT_LENGTH} always returns the correct number, so the multipart/form-data and content upload is ok. . When uploading a 1Gb file, I do see the CGIxxxx temp file in C:\Windows\temp increasing in size. so it's not permissions issue with Windows 7 . The problem seems to be that the CGIxxx temp file is deleted instantly before an upload handle is generated . In some versions of CGI.PM (I can't tell you the exact one, but between 3.29 and 3.39 the CGIxxx temp file is written into the local script folder instead of a temp folder. The problem there is two-fold: it still doesn't return an upload handle and it doesn't delete the temp file either! CODE $filename = $q->param('Hfile'); $type = $q->uploadInfo($filename)->{'Content-Type'}; $tmpfilename = $q->tmpFileName($filename); $filesize=-s $tmpfilename; $ZLOG.="Received file '$in{Hfile}' according to \$ENV{CONTENT_LENGTH} is size $ENV{'CONTENT_LENGTH'}<BR>"; $ZLOG.="Running CGI.PM $CGI::VERSION<BR>"; $ZLOG.="Temporary file name is '$tmpfilename' and the type is '$type' with size of '$filesize'. <BR>"; $lightweight_fh = $q->upload('Hfile'); $ZLOG.="The handle is '$lightweight_fh'<BR>"; FAILED OUTPUT ON WIN7-64 DEV PLATFORM Received file ' httpd.conf ' according to $ENV{CONTENT_LENGTH} is size 19324 Running CGI.PM 3.49 Temporary file name is 'C:\Windows\TEMP\CGItemp63983' and the type is 'text/plain' with size of ''. The handle is '' SUCCESSFUL OUTPUT ON LINUX BLUEHOST AND WINXP PLATFORM Received file 'httpd.conf' according to $ENV{CONTENT_LENGTH} is size 19324 Running CGI.PM 3.49 Temporary file name is '/usr/tmp/CGItemp30111' and the type is 'text/plain' with size of '18847'. The handle is 'httpd.conf' 534 bytes loaded. Relevant external post http://forums.devshed.com/perl-programming-6/cgi-upload-problem-on-windows-c omputer-cgi-pm-related-669763.html#post2451887
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: us-ascii
Content-Length: 10560
Download (untitled) / with headers
text/html 10.3k
From mark [...] summersault.com Wed Apr 21 09: 14:43 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.339 tagged_above=-99.9 required=10 tests=[AWL=0.664, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8, SPF_SOFTFAIL=0.596] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-26543-1271851302-999.56780-4-0 [...] rt.cpan.org>
X-Mailer: Claws Mail 3.7.5 (GTK+ 2.12.9; i486-pc-linux-gnu)
X-Spam-Flag: NO
References: <RT-Ticket-56780 [...] rt.cpan.org> <006601cae14a$59e2b660$0da82320$ [...] imperial.cc> <rt-3.8.HEAD-26543-1271851302-999.56780-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20100421091432.53d82bce [...] summersault.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -9.339
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 271022406AE for <cpan-bug+CGI.pm [...] hipster.bestpractical.com>; Wed, 21 Apr 2010 09:14:43 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rQov0pxHJIUp for <cpan-bug+CGI.pm [...] hipster.bestpractical.com>; Wed, 21 Apr 2010 09:14:41 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id A766B2406AA for <bug-CGI.pm [...] rt.cpan.org>; Wed, 21 Apr 2010 09:14:40 -0400 (EDT)
Received: (qmail 29508 invoked by uid 103); 21 Apr 2010 13:14:40 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 21 Apr 2010 13:14:40 -0000
Received: from tanagra.summersault.com (HELO tanagra.summersault.com) (12.161.105.149) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 21 Apr 2010 06:14:36 -0700
Received: (qmail 45802 invoked from network); 21 Apr 2010 13:14:33 -0000
Received: from simba.summersault.com (HELO localhost) (192.168.97.182) by tanagra.summersault.com with SMTP; 21 Apr 2010 13:14:33 -0000
Delivered-To: cpan-bug+CGI.pm [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #56780] Windows 7 and CGI.PM undefined upload handle
Return-Path: <mark [...] summersault.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+CGI.pm [...] hipster.bestpractical.com
X-RT-Mail-Extension: cgi.pm
Date: Wed, 21 Apr 2010 09:14:32 -0400
X-Spam-Level:
To: bug-CGI.pm [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Mark Stosberg <mark [...] summersault.com>
RT-Message-ID: <rt-3.8.HEAD-26546-1271855684-1498.56780-0-0 [...] rt.cpan.org>
Content-Length: 223
Download (untitled) / with headers
text/plain 223b
Thanks for the detailed reports, Jason. I'm not aware that any of the current CGI.pm contributors are Windows 7 users, but a patch is welcome, and you could also ask for help in general forum like perlmonks.org. Mark
X-RT-Interface: REST
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
RT-Message-ID: <rt-4.0.18-6007-1400760488-452.56780-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 240
Download (untitled) / with headers
text/plain 240b
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/73 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
MIME-Version: 1.0
In-Reply-To: <006601cae14a$59e2b660$0da82320$ [...] imperial.cc>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <006601cae14a$59e2b660$0da82320$ [...] imperial.cc>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-6853-1411934549-61.56780-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 411
Download (untitled) / with headers
text/plain 411b
I've refactored all the temporary file handling logic to use File::Temp so this issue should no longer be present. Dev version is available for testing, 4.04_02, so if you can have a look and confirm/deny then that would be useful. Either way, i'm closing this as it's not something i have the resources or time to look at, so i'm going to cop out and say "patches (with tests) welcome" if the problem persists.


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.