Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 24048 invoked from network); 17 Mar 2005 01:16:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Mar 2005 01:16:27 -0000 Received: (qmail 55531 invoked by uid 500); 17 Mar 2005 01:16:27 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 55509 invoked by uid 500); 17 Mar 2005 01:16:26 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 55494 invoked by uid 99); 17 Mar 2005 01:16:26 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from alpha1.its.monash.edu.au (HELO ALPHA1.ITS.MONASH.EDU.AU) (130.194.1.1) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 16 Mar 2005 17:16:25 -0800 Received: from localhost ([130.194.13.82]) by vaxc.its.monash.edu.au (PMDF V6.1 #39306) with ESMTP id <01LLZWVO9ZLA9380O4@vaxc.its.monash.edu.au> for embperl@perl.apache.org; Thu, 17 Mar 2005 12:16:10 +1100 Received: from larry.its.monash.edu.au (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with ESMTP id EF84480003 for ; Thu, 17 Mar 2005 12:16:09 +1100 (EST) Received: from katsumi (katsumi.its.monash.edu.au [130.194.2.189]) by larry.its.monash.edu.au (Postfix) with ESMTP id D6D6F3C00E for ; Thu, 17 Mar 2005 12:16:09 +1100 (EST) Received: by katsumi (Postfix, from userid 1000) id E1C8F272480; Thu, 17 Mar 2005 12:16:10 +1100 (EST) Date: Thu, 17 Mar 2005 12:16:10 +1100 From: Robert Norris Subject: [RESEND] Empty file uploads To: embperl@perl.apache.org Message-id: <20050317011610.GB20385@katsumi> MIME-version: 1.0 Content-type: multipart/signed; boundary=l76fUT7nc3MelDdI; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --l76fUT7nc3MelDdI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline [Resending, because I need guidance. I realise that file uploads are working fine for most people, so I'm not expecting an answer, but I'm hopeful that someone can tell me where to start looking.] I've noticed that file uploads don't seem to always work. The uploaded file appears to come through empty most of the time. Usually it works after restarting the browser, or the server, but not after that. If I'm lucky, one request will go through, but thats pretty rare, and there doesn't seem to be any pattern. I'm using Embperl 2.0rc2 with Perl 5.6.1. I have the following code for the form:
File:
To read the file, I use the following Perl: my $fh = $fdat{'file'}; my $raw = do { local $/; <$fh> }; (I've noticed that the returned filehandle doesn't always seem to act like a real filename - certain methods don't always work. This way seems safe). Most of the time $raw comes back empty. Using Data::Dumper on %fdat, I get something like this when it works: $VAR1 = { '-file' => { 'Content-Disposition' => 'form-data; name="file"; filename="somefile.txt"', 'Content-Type' => 'text/plain' }, 'file' => bless( \*{'Fh::fh00001somefile.txt'}, 'Fh' ) }; When it fails, I get this instead: $VAR1 = { '-file' => undef, 'file' => bless( \*{'Fh::fh00001somefile.txt'}, 'Fh' ) }; It seems that the browser is at least doing the right thing, because the CONTENT_LENGTH and CONTENT_TYPE environment variables seem to be set correctly: CONTENT_LENGTH = 98542 CONTENT_TYPE = multipart/form-data; boundary=---------------------------12726745371892987527108562749 Anyone seeing this? Where should be looking to find the solution? Thanks, Rob. --l76fUT7nc3MelDdI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCONpaWb13Z/wY5sIRAl/jAJ9wJjKl2s40Q1Tj8qaXyMNbjs/NbACeNgow wN/wLiBhW3nvQUpX9RGJ1j8= =Jyh5 -----END PGP SIGNATURE----- --l76fUT7nc3MelDdI--