> hi
>
> ( 04.08.02 19:32 -0400 ) Alex Brelsfoard:
>> But I am a bit curious to know if there is a way to do this without
>> using CGI.pm.
>
> sure, mod_perl [much faster, lighter]. the interface is a bit better
> than CGI.pm, but not a whole lot. i just think it's a tricky thing to be
> doing anyway [uploading files].
>
Perhaps I should start looking into using mod_perl then. Because even
with Ron and Sean's suggestions, I am still not able to get this function
to work. (sorry guys, thanks though).
#I list these two lines up at the top of my file.
use CGI qw/:standard/;
$query = new CGI;
# Here is my function:
sub UploadPicture {
my $photoID = $_[0]; # ID # for photo
my $file = $_[1]; # field name from <form>
my $picLoc = $_[2]; #any extra directory needed.
my $filepath = "$UPLOAD_DIR/$picLoc$photoID$file\.jpg";
# Already did "" statement outside this function.
my $picture = $query->upload("$file");
open (UPLOAD, ">$filepath") || &Error("Could not write: $filepath");
while ($bytesread=read($picture,$buffer,1024))
{ print UPLOAD $buffer; }
close (UPLOAD);
}
I take in all the variables with the use of CGI as well, just to keep
things consistant. But I still keep getting zero byte files....
As a side note, I do hope to elarn how to use ImageMagik at some point as
well. Any advice on this would be MUCH appreciated.
--Alex
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm