I have a file download script that I have written, which reads files from below public_html and allows the user to download them after checking to see if the user is logged
Apple has locked down the iOS devices so that you can't access the file structure. As such, they have disabled file downloads.
iOS Safari does not support file download..
Update: But if you are looking to open the .doc files on iPad then yes.. you can do that...
use following -
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/msword");
readfile('file.doc');
the only difference in your code and mine is I removed the header for attachment Just remove these header -
header("Content-Disposition: attachment; filename=\"file.doc\";" );
header("Content-Length: 50688");
Actually you can check for client operating system if operating system is iOS then don't add header for download like this -
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/msword");
if (!Operating_System_Is_IOS)
{
header("Content-Disposition: attachment; filename=\"file.doc\";" );
header("Content-Length: 50688");
}
readfile(SITE_PATH .'/files/file.doc');
You can force the user to paste the link (with a time limited ID in it due to log in ...) into any third party app, like GoodReader. Or just let them view the doc file in the browser.