For some reason my file downloads out of MySQL are crapping-out after 64-66kb, even through the file_size is over 100k. What could be causing this? I'm using the following code;
function download($file_id, $id){
$query = @db_query("SELECT bin_data, file_type, file_name, file_size FROM files WHERE id = '$file_id' and id = '$id'");
$result = db_fetch_object($query);
header("Content-type: $result->file_type");
header("Content-length: $result->file_size");
header("Content-Disposition: attachment; filename=$result->file_name");
header("Content-Description: PHP Generated Data");
echo $result->bin_data;
}
the db_query and db_fetch_object functions are just part of an abstraction layer that call mysql functions.
Thanks