Need help working with PDF, DOC and image files

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
rfeio
Forum Newbie
Posts: 15
Joined: Fri Aug 22, 2008 4:23 am

Need help working with PDF, DOC and image files

Post by rfeio »

Hi,

I would appreciate any help anyone could give me on this subject. I need to create a script that does:

1. Upload files (allowed formats): PDF, Word Doc, RTF, JPG, GIF, BMP

2. Validate that the file format uploaded corresponds to the ones allowed

3. Search inside PDF, Word Doc and RTF files.


I'm ok with uploading the files, but I don't know how to validate their formats and how to do a search inside a PDF, DOC or RTF file.

Cheers,

R
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Need help working with PDF, DOC and image files

Post by pickle »

Verifying the filetype: http://ca3.php.net/manual/en/function.finfo-file.php

Do a Google search for reading PDFs, reading DOC, and reading RTF. They're quite different formats, so you'll likely need 3 different approaches.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply