hello all
im looking to make a download script as i cannot use the .htaccess to
control directory access to files as im using a php login system using
mysql and sessions.
i have been playing about with fopen and fpassthru but having a few
problems making the file download. The files involved would mainly be
but not limited to .pdfs, .docs and .zips
i have created the following:
$filepath = '/home/me/folder/file.zip';
$size = filesize($filepath);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=download.zip");
header("Content-Length: ".$size);
$ok = fopen($filepath, 'rb');
fpassthru($ok);
this pops up the download box and downloads in firefox, but in ie it
pops up the box and then fails. any ideas?
im guessing its something else that i need to put into my headers but
i've no idea what. i've been playing with cache and the mime type but
this seems to download still in firefox but display the text version of
the zip file in the window in ie.
Thanks for any advice.