Forcing Print w/ Headers or Javascript?

From: Jason (jason_at_nospamplease.com)
Date: 09/28/04


Date: Tue, 28 Sep 2004 04:09:48 GMT

I know this isn't a strictly PHP question, but I'm hoping somebody else
has addressed something similar.

I'm using php to build a document management system. I have a database
that references Microsoft Word documents (yep, gotta be M$ Word docs).

I can use the following PHP code to force a document to save on the
client's browser:

<?php
header("Content-type: application/ms-word");
header("Content-Disposition: attachment; filename=foo.doc" );
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");

readfile("/usr/files/foo.doc");
?>

I was wondering if somebody had a solution for making a php script that
would trigger a *print* of the .doc file (assuming the user has
Microsoft Word) while avoiding client-side COM scripting in Internet
Exploder (if possible).



Relevant Pages

  • Re: Attempt to de-mystify AJAX
    ... created and populated by the PHP script. ... string is initialized in line 1 to the opening select tag. ...
    (comp.databases.pick)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: High Scores
    ... If you want to view High scores it returns Could Not load scores ... here is the PHP script ... Edit the game Flash file to point to this file on your server ... >> And the PHP script is here ...
    (alt.php)