cgi uploader script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • HOLY RHAPSODY
    Private

    • Mar 2007
    • 1

    cgi uploader script

    first of all here is the script:
    Code:
    #!/usr/bin/perl -w
    
    use CGI;
    use CGI::Carp qw(fatalsToBrowser);
    
    
    $upload_dir = "/home/yumeqnm/public_html/dobouncers/forums/files";
    
    $query = new CGI;
    
    $filename = $query->param("video");
    $email_address = $query->param("email_address");
    
    $filename =~ s/.*[\/\\](.*)/$1/;
    
    $upload_filehandle = $query->upload("video");
    
    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
    This is the error i recieve when trying to upload:
    Code:
    [B]Software error:[/B]
    
     Can't find string terminator "END_HTML" anywhere before EOF at upload.cgi line 28.
     For help, please send mail to the webmaster (12314@76565.com), giving this error message  and the time and date of the error.
    As you can see there is the "END_HTML" at the end, no spaces after. I don't know what the problem could be.
Working...
X