dulla
Technical User
- Feb 3, 2003
- 54
I am trying to sending a file to my server. I have obtained a script that i cannot get to work. the html is here:
I have set the permissions and changed the variables, yet i still get 'server error premature end of script headers' as an error. any ideas? the referenced cgi script is:
#!/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 <<END_HTML;
<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="/upload/$filename" border="0">
</BODY>
</HTML>
END_HTML
I have set the permissions and changed the variables, yet i still get 'server error premature end of script headers' as an error. any ideas? the referenced cgi script is:
#!/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 <<END_HTML;
<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="/upload/$filename" border="0">
</BODY>
</HTML>
END_HTML