print "Content-Type: application/x-unknown-download_file\nContent-Disposition: attachment\; filename=\"".$fileOBJ->data('filename')."\"\nContent-Length: $size\n\n"; #### 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-Disposition: attachment\; filename=\"".$fileOBJ->data('filename')."\"\nContent-Length: $size\n\n"; # here's the downloading part, no arrays needed while ($bytes = read($DLFILE,$buffer,16384)) { print $buffer; }