As suggested elsewhere here, let the client (Browser) do the work for you. Easiest way is a link to the file (don't forget to name the file with .doc extension, other wise browsers get confused, mostly) or if you don't want to provide a link (may be you have the file in your database), write the appropriate headers (content-type: application/octet-stream , im not sure on this one though) and print the file to the client (browser)