I've just installed File Manager version 1.0 and all gif and jpg files upploaded are corrupted. I've read some messages concerning this problem at the forum, but the cgi code seems to be right. What can be possibly wrong?
hi webranger:
Can you locate these lines in sub upload in fileman.cgi:
open (OUTFILE, ">$fullfile") or &cgierr ("Can't open: '$fullfile'.\nReason: $!");
binmode (OUTFILE); # For those O/S that care.
The important thing is that you have binmode (OUTFILE) because it seems to me that your gif and jpg files have been uploaded in ASCII mode.
Please check this out and get back to me and I will see what I can do to solve the problem.
Cheers
Sun
Can you locate these lines in sub upload in fileman.cgi:
open (OUTFILE, ">$fullfile") or &cgierr ("Can't open: '$fullfile'.\nReason: $!");
binmode (OUTFILE); # For those O/S that care.
The important thing is that you have binmode (OUTFILE) because it seems to me that your gif and jpg files have been uploaded in ASCII mode.
Please check this out and get back to me and I will see what I can do to solve the problem.
Cheers
Sun
Dec 17, 1999, 7:16 AM
New User (3 posts)
Dec 17, 1999, 7:16 AM
Post #3 of 3
Views: 2952
I've found these lines in the code :
What can possibly be up with it?
--------------------------------
open (OUTFILE, ">$fullfile") or &cgierr ("Can't open: '$fullfile'.\nReason: $!");
binmode (OUTFILE); # For those O/S that care.
while ($bytesread=read($data,$buffer,1024)) {
($fullfile =~ /cgi|pl$/) and ($buffer =~ s/\r//g);
print OUTFILE $buffer;
$file_size += 1024;
if (($file_size / 1000) > $free_space) {
close OUTFILE;
unlink ($fullfile) or &cgierr ("Can't unlink: $fullfile. Reason: $!");
return (0, "Upload: Not enough free space to upload that file. Space left:
What can possibly be up with it?
--------------------------------
open (OUTFILE, ">$fullfile") or &cgierr ("Can't open: '$fullfile'.\nReason: $!");
binmode (OUTFILE); # For those O/S that care.
while ($bytesread=read($data,$buffer,1024)) {
($fullfile =~ /cgi|pl$/) and ($buffer =~ s/\r//g);
print OUTFILE $buffer;
$file_size += 1024;
if (($file_size / 1000) > $free_space) {
close OUTFILE;
unlink ($fullfile) or &cgierr ("Can't unlink: $fullfile. Reason: $!");
return (0, "Upload: Not enough free space to upload that file. Space left: