Then, in docfile.php, use a header to set the MIME type.
Then, if the user is running IE, you can have it viewed in the browser with:
header("Content-Disposition: attachment; filename=$filename");
to have it save to the local computer, where $filename is the name you want it to be saved as.
Then just throw in your content.