How can I upload a file to my server WITHOUT using CGI.pm module (UNIX server)? Because the ENCTYPE is set to "multipart/form-data" I can't (don't know how to) get variables from the HTTP POST otherwise then using CGI.pm.
This is what I've been using so far, but it is important that I can do this without using CGI.pm:
use CGI;
$q=new CGI;
my $file = $q->param("FILE"
# here is some extension checking which isn't important now
open (OUTFILE, ">outfile.jpg" || die "Can't copy file to the server. Please notify site administrator";
while (my $bytesread = read($file, my $buffer, 1024)) {print OUTFILE $buffer;}
close (OUTFILE);
# end then continue what you've been doing
Thanks!
This is what I've been using so far, but it is important that I can do this without using CGI.pm:
use CGI;
$q=new CGI;
my $file = $q->param("FILE"
# here is some extension checking which isn't important now
open (OUTFILE, ">outfile.jpg" || die "Can't copy file to the server. Please notify site administrator";
while (my $bytesread = read($file, my $buffer, 1024)) {print OUTFILE $buffer;}
close (OUTFILE);
# end then continue what you've been doing
Thanks!