Re: converting word document to plain text file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 20 April 2005 23:14, Cima wrote:

> them. is there a way to these types of files in php or some other way?


The easiest way is to tell your users you expect file format to be text only.  
You can test for mime type by using built-in php functions (and should do 
so!).

The hard way means that you need a parser for pdf, rtf, and doc files.  PDF is 
open format so there will no doubt be some PEAR module for it.  Rtf is quit 
ieasy to parse yourself, and doc is m$ propriety so that will be a lot more 
difficult to implement.

Or better, you might find a commandline tool that can do the job for you, and 
call that from within php.  Before doing so, please take at least one day to 
study security.  Since you provide your users with a way to transfer files to 
your server.  And you process those files then possibly users can hack your 
server.


When you got it working, report back here and ask us to analyze your code for 
pointers on how to make it more secure.

Good luck!


Andy

ps: Google is your friend!

http://www.google.com/search?num=100&q=%22read+pdf%22+%2Bphp&btnG=Search

Also search on PEAR
http://pear.php.net

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>++++$@ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux