Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php force save

Status
Not open for further replies.

hyrogen

Programmer
Jul 10, 2003
60
GB
Im using:
header('Content-Type: application/msword;');
header("Content-Disposition: attachment; filename=bill.doc");

readfile($new_file);

To output a dynamically generated word file to a browser. It seems to work fine if you save the file first, but if you just click open, you get a 'cannot open file' error. Any ideas why this might be?

If not, is it possible to force the user to save the file to the drive first and not open it?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top