Ok, I've got a script to push out file downloads. It's based on this: Link
The relevant bit from download.cgi seems to be this:
open(DLFILE, "<$files_location/$ID") || Session::session_error("Failed opening file $ID for download.");
@fileholder = <DLFILE>;
close (DLFILE) || Session::session_error("Failed closing file $ID");
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$ID\n\n";
print @fileholder;
print "\n\n\n";
It works fine ... some of the time.
But sometimes when I click the link that calls this script, I get an internal server error. Server log shows:
[Mon Jul 12 11:39:40 2004] [error] [client ***.***.**.***] Premature end of script headers: download.cgi, referer: http://www.mydomain.org/perl/bulk_files.pl
[Mon Jul 12 11:39:40 2004] [warn] /perl/download.cgi did not send an HTTP header
[Mon Jul 12 11:39:40 2004] [error] 23142: ModPerl::Registry: 500:Unknown error 500 at /var/www/cgi-perl/download.cgi line 46.!
Any ideas?
Thanks!
The relevant bit from download.cgi seems to be this:
open(DLFILE, "<$files_location/$ID") || Session::session_error("Failed opening file $ID for download.");
@fileholder = <DLFILE>;
close (DLFILE) || Session::session_error("Failed closing file $ID");
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$ID\n\n";
print @fileholder;
print "\n\n\n";
It works fine ... some of the time.
But sometimes when I click the link that calls this script, I get an internal server error. Server log shows:
[Mon Jul 12 11:39:40 2004] [error] [client ***.***.**.***] Premature end of script headers: download.cgi, referer: http://www.mydomain.org/perl/bulk_files.pl
[Mon Jul 12 11:39:40 2004] [warn] /perl/download.cgi did not send an HTTP header
[Mon Jul 12 11:39:40 2004] [error] 23142: ModPerl::Registry: 500:Unknown error 500 at /var/www/cgi-perl/download.cgi line 46.!
Any ideas?
Thanks!