Page 1 of 1

Need help working with PDF, DOC and image files

Posted: Thu Mar 12, 2009 5:20 pm
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

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

Posted: Fri Mar 13, 2009 10:25 am
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.