i have a little download script setup here and it works well SOMETIMES. I have narrowed down the problem to the response headers being sent only majority of the times and when they dont what happens is that it asks me to download the file giving no information about it except for its name on disk and that its being downloaded as as 'application/octet-stream'. here are the headers i am sending
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.$file->logical_name.'"');
header('Content-Type: "'.$mime.'"');
header("Content-Length: ".filesize($this->file));
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');
readfile($this->file);
so to be clear about my issue the file information is only being sent sometimes and when they dont i get my issue, which is no information about the file being sent hence it being downloaded as an weired named(as on disk) 'application/octet-stream'
UPDATE
this dosnt happen with smaller files around less than 100kb