I am using a blob field to store files anywhere up to 8mb in size. It seems to work fine, however in my download script, the file downloads to a tmp directory first with this long pause, then it brings up the 'Save As' dialoge box. Here is my script I am using:
$sql = "SELECT str_file_name, int_file_size, str_file_type, blb_file FROM tbl_file WHERE int_file_id='".$_GET['fileID']."'";
$result = @mysql_query($sql) or die("Could not pull from tbl_file: ".mysql_error());
$data = @mysql_result($result, 0, "blb_file");
$filename = @mysql_result($result, 0, "str_file_name");
$size = @mysql_result($result, 0, "int_file_size");
$type = @mysql_result($result, 0, "str_file_type");
header("Content-type: $type");
header("Content-length: $size");
header("Content-Disposition: attachment; filename=$name");
header("Content-Description: PHP Generated Data");
echo $data;
This happens in both firefox and IE. Is there a way to reverse the process and get the dialoge box first?
Thanks alot!