PHP word conversion

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hemant_419
Forum Newbie
Posts: 1
Joined: Tue Aug 16, 2005 12:51 am
Contact:

PHP word conversion

Post 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.....................
User avatar
shoebappa
Forum Contributor
Posts: 158
Joined: Mon Jul 11, 2005 9:14 pm
Location: Norfolk, VA

Post 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');
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Moved to PHP - Code.
Post Reply