S
Sphinx
Hi,
On my website, I am trying to use following perl script to download an
..exe file from server. This script downloads a smaller file then the
original one, (leaving nearly 100 bytes). I tried to compare the
contents (binary) of both files and they are same.
I am not sure why the size changed but there is no content change. The
exe file is a program installable and I am unable to install it after
download.
Even I tried to download a zip file with mime application/zip, that is
also invalid with 57 bytes missing and winzip doesn't read that. Text
file download works file.
I think I am using correct mime type; anyone has any idea, what could
be the problem?
Here is the script.
my $fileName="myfile.exe";
open(OUTFILE, $fileName) || die "Unable to open file..\n";
print "Content-type: application/octet-stream \n";
print "Content-disposition: filename=\"$fileName\"\n";
print "Content-Description: my exe file \n\n";
while(<OUTFILE>) {
print $_;
}
close(OUTFILE);
}
Thanks
-Kamran
On my website, I am trying to use following perl script to download an
..exe file from server. This script downloads a smaller file then the
original one, (leaving nearly 100 bytes). I tried to compare the
contents (binary) of both files and they are same.
I am not sure why the size changed but there is no content change. The
exe file is a program installable and I am unable to install it after
download.
Even I tried to download a zip file with mime application/zip, that is
also invalid with 57 bytes missing and winzip doesn't read that. Text
file download works file.
I think I am using correct mime type; anyone has any idea, what could
be the problem?
Here is the script.
my $fileName="myfile.exe";
open(OUTFILE, $fileName) || die "Unable to open file..\n";
print "Content-type: application/octet-stream \n";
print "Content-disposition: filename=\"$fileName\"\n";
print "Content-Description: my exe file \n\n";
while(<OUTFILE>) {
print $_;
}
close(OUTFILE);
}
Thanks
-Kamran