
Anthony
Deleted
Sep 14, 2000, 5:57 AM
Post #3 of 9
(4103 views)
|
Okay, so it seemed to be Assumption No. 1: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl use CGI qw/:all/; $query = new CGI; if (!param()) { print header(); print $query->start_multipart_form('post','upload.cgi'); print $query->textfield('imgname','',20,50); print "<br>"; print $query->filefield('imgfile','',20,80); print "<br>"; print $query->submit(); print $query->endform(); } else { $imgname = $query->param('imgname'); $imgfile = $query->param('imgfile'); # Copy a binary file to somewhere safe open (OUTFILE,">/www/logos/$imgname"); while ($bytesread=read($imgfile,$buffer,1024)) { print OUTFILE $buffer; } close (OUTFILE); print "Location: http://www.raging.com\n\n"; exit; } </pre><HR></BLOCKQUOTE> Setting the encoding type to multipart (using the CGI interface to form building, which I plan to change) worked out just fine. Thanks for your help perlkid. Oh, since the site helped me so much, I'll plug Perldoc.com (http://www.perldoc.com). All (or at least nearly all) the perl docs, including a load of module docs from CPAN. All HTMLized, easy to search, fast and readable. Kudos to Carlos Ramirez. -- Anthony Bouvier Vagabond Philosopher --
|