Trying to write a script that will force a download in the header. Using code found here:
$filesize = filesize("$fullpath");
Header("Content-Length: $filesize");
Header("Content-type: application/download");
Header("Content-Disposition-type: attachment");
Header("Content-Disposition: filename=$filename");
Header("Content-Transfer-Encoding: binary");
$fp = fopen("$filename","rb");
$result = fpassthru($fp);
exit;
What is strange about this is that this code does work (the save file dialog pops up, etc..), as long as a session isn't in progress.
It breaks when sessions_start() is called -- IE5.5 freaks out and says "Unable to find internet site". Which is tragic, because I need to use sessions for this job.
Has anyone else run into this issue? Is this an IE issue, and is there a work-around?