perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saadiq <saa...@nyc.rr.com>
Subject Re: uploading files results in an empty file
Date Thu, 27 Mar 2003 01:23:53 GMT
I know you mentioned that you were using a multipart form with a file 
field, but I thought I would mention this anyway because these symptoms 
sound very familiar.

I had the same problem when I tried to copy code from one working page 
to another but forgot to set the form to ENCTYPE="multipart/form-data". 
  I was able to create the uploaded files they'd be of size 0.  It was 
resolved by properly setting the enctype.  I'd recheck that form tag 
just to be certain.  Good luck.

Saadiq

On Wednesday, March 26, 2003, at 07:41  PM, Richard Schilling wrote:

> Having a particular problem today that I wasn't yesterday :-)
>
> Using the following code to upload a file from a multipart
> form with a file field in it:
>
> [-
>
> if (defined $fdat{developmentmapfile}) {
>
> 	open NF, "> /usr/local/apache/htdocs/images/$fdat
> {'developmentmapfile'}" or die $! . ": Can't open file $fdat
> {'developmentmapfile'}.";
> 	binmode NF;
> 	print NF $buffer while read ($fdat
> {developmentmapfile}, $buffer, 32768) or die $! . ": Can't
> write to permanent file during upload.";
> 	close NF;
> }
>
> -]
>
> The images directory is set to owner nobody, and group nobody.
>
> The file is created, but the code dies when it tries to print
> to NF.  After the script dies, the file size is left at 0.
> Can't for the life of me figure out what's missing.
>
> Anyone?
>
> Thanks.
>
>
> --Richard Schilling
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message