RE: Is this really a pdf?

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

 



If your server has the appropriate programs installed, there ARE some
command line utilities that can take a PDF and convert it to another form;
You can execute them with an exec call. Theoretically, if the PDF is corrupt
they will print out some kind of error which you can capture.

It could also take up a ton of processing power if you do a lot of this, so
be careful on the implementation. (o:

I don't know if this is an option for you or not, but it is something that
was done at my last company to verify that uploaded PDFs were at least
readable by -something-.

For Linux there is pdf2ps, and iirc there is some other program out there
that just pulls out the text.

HTH,
-K.Bear

-----Original Message-----
From: Sjef [mailto:manuals-scripts@xxxxxxxxx] 
Sent: Tuesday, August 08, 2006 6:09 AM
To: php-general@xxxxxxxxxxxxx
Subject: Re:  Is this really a pdf?

Thanxs very much  guys!
I do realize that it is not foolproof, but better than nothing. In my 
situation mime_content_type doesn't work, so I will have to settle for the 
other method.
Sjef 

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

-- 
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