I found this script on the web:
use CGI;
$upload_dir = "/";
$query = new CGI;
$filename = $query->param("photo"); $email_address = $query->param("email_address"); $filename =~ s/.*[\/\\](.*)/$1/; $upload_filehandle = $query->upload("photo");
open UPLOADFILE, ">$upload_dir/$filename";
while ( <$upload_filehandle> ) { print UPLOADFILE; }
close UPLOADFILE;
print $query->header ( );
print "Content-type: text/html\n\n";
print qq|
<HTML> <HEAD> <TITLE>Thanks!</TITLE> </HEAD>
<BODY>
<P>Thanks for uploading your photo!</P> <P>Your email address: $email_address</P> <P>Your photo:</P> <img src="/$filename" border="0">
</BODY> </HTML>
|;
that is running here:
http://server5.hypermart.net/...ileupload/upload.htm
This error in the hypermart log is:
Undefined subroutine CGI::upload
How can this be fixed?
---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote:
#!/usr/bin/perl -w use CGI;
$upload_dir = "/";
$query = new CGI;
$filename = $query->param("photo"); $email_address = $query->param("email_address"); $filename =~ s/.*[\/\\](.*)/$1/; $upload_filehandle = $query->upload("photo");
open UPLOADFILE, ">$upload_dir/$filename";
while ( <$upload_filehandle> ) { print UPLOADFILE; }
close UPLOADFILE;
print $query->header ( );
print "Content-type: text/html\n\n";
print qq|
<HTML> <HEAD> <TITLE>Thanks!</TITLE> </HEAD>
<BODY>
<P>Thanks for uploading your photo!</P> <P>Your email address: $email_address</P> <P>Your photo:</P> <img src="/$filename" border="0">
</BODY> </HTML>
|;
that is running here:
http://server5.hypermart.net/...ileupload/upload.htm
This error in the hypermart log is:
Undefined subroutine CGI::upload
How can this be fixed?
---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------