Page 1 of 1

PHP word conversion

Posted: Tue Aug 16, 2005 1:06 am
by hemant_419
i m a php developer and only on windows platform i have worked on.
i am facing a problem i.e

our is a job website where users post their resumes and then employer side.\
Now we need to display them(word or .doc profiles) using php on to the browser window.
But simple file reading/writing fails because it contains lots of junk characters.


how can i do it.

please help.....................

Posted: Tue Aug 16, 2005 6:47 am
by shoebappa
I'd recommend just sending the file, then they can choose to download it, or view it with the Office viewer (it's free...).

This came from the PHP Manual...

If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the Content-Disposition header to supply a recommended filename and force the browser to display the save dialog.

Code: Select all

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>

Posted: Tue Aug 16, 2005 7:13 am
by feyd
Moved to PHP - Code.