in reply to saving the file uploaded...

question 1: is your form set with ENCTYPE="formdata/multi-part" ?

Yes :
CGI returns a magic GLOB for you.
$FileHandle = GGI::->new(); $FileStream = $FileHandle->('AUT_file');
gives you an actual GLOB. However, if you do:
print $FileStream,"\n";
you'll notice that is prints the filename. If you do:
print <$FileStream>,"\n";
you'll notice it will print the file-data.

No :
Fix that - (eg: <form METHOD="POST" ACTION="my_script.cgi" ENCTYPE="formdata/multi-part"> ) and then read part 'Yes'



Sinister greetings.
"With tying hashes you can do everything God and Larry have forbidden" -- Johan Vromans - YAPC::Europe 2001
perldoc -q $_

Replies are listed 'Best First'.
Re: Re: saving the file uploaded...
by PriNet (Monk) on Feb 28, 2002 at 20:02 UTC
    earthboundmisfit thanx for that one, that fixed my internal server error... and Sinister ?... too cool, it worked ! ( i was using the right encrypt... thanx for noting...)(for a jpg anyway) gonna run with it...thanx guys.... Final Code:
    #!/usr/bin/perl use strict; use CGI qw/:standard/; ############################################################## ### Variable Definitions ### ############################################################## my($FileHandle) = ""; my($FileStream) = ""; ############################################################## ### Main Program Begins Here ### ############################################################## $FileHandle = CGI::->new(); $FileStream = $FileHandle->param('AUT_File'); open (OUTFILE, ">test.jpg"); print OUTFILE <$FileStream>; close (OUTFILE);
    hey, i was close... *heh* thanx again everyone... i been trying this "feature" for my gallery for weeks....lol -gary