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
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');