perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kee Hinckley <naz...@somewhere.com>
Subject Re: Upload file
Date Thu, 09 Oct 2003 13:36:30 GMT
At 12:25 AM +0200 10/9/03, Rado Petrik wrote:
>Hi, I have this script.
>
><FORM METHOD="POST" ENCTYPE="multipart/form-data">
>   <input TYPE="FILE" NAME="ImageName" >
></FORM>
>
>[-          
>
>if (defined $fdat{ImageName}) {
>      open FILE, "> test ;
>      print FILE $buffer
>      while read($fdat{ImageName}, $buffer, 32768);
>      close FILE;
>}
>
>-]
>
>File test exist but have size 0 k.
>I have Embperl v 1.3.6.

Try checking for errors first.

if (defined $fdat{ImageName}) {
	open FILE ">test" || die("open test: $!");
	while (read($fdat{ImageName}, $buffer, 32768)) {
		print FILE $buffer || die("print test: $!");
	}
	close FILE || die("close test: $!");
}
-- 
Kee Hinckley
http://www.messagefire.com/         Next Generation Spam Defense
http://commons.somewhere.com/buzz/  Writings on Technology and Society

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

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


Mime
View raw message