in reply to Binary output ot browser/force download?
I use the line:print "Content-Type: application/x-unknown-download_file\nContent-Disp +osition: attachment\; filename=\"".$fileOBJ->data('filename')."\"\nCo +ntent-Length: $size\n\n";
That should do it.open(my $DLFILE, $file); my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, +$blksize,$blocks) = stat($DLFILE); print "Content-Type: application/x-unknown-download_file\nContent-Disp +osition: attachment\; filename=\"".$fileOBJ->data('filename')."\"\nCo +ntent-Length: $size\n\n"; # here's the downloading part, no arrays needed while ($bytes = read($DLFILE,$buffer,16384)) { print $buffer; }
|
|---|