Im using CGI Perl to upload file to my server. The script works, it does upload the file when i check the directory. But the page displays this error every time.
I have a valid file name check etc.
#!/usr/bin/perl
use strict;
use CGI;
use CGI::Carp qw ( fatalsToBrowser );
use File::Basename;
my $upload_to = "/home/username/public_html/uploads";
my $query = new CGI;
my $picture = $query->param("picture");
my $picture_handle = $query->upload("picture");
open( UPLOADFILE, ">$upload_to/$picture");
binmode UPLOADFILE;
while ( <$picture_handle> )
{
print UPLOADFILE;
} close UPLOADFILE;
print '<html>';
print '<body>';
print '<h1>Upload Successfull!</h1>';
print '</body>';
print '</html>';
This is the error.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, request@domain and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
error_logwhenever you get the Internal Server Error. (Unless you're on one of those systems where you don't have access to it. That sucks.) It is usually in/var/log/httpd/or/var/log/apache2/. - Amadan