Detect PDF was uploaded Detect PDF was uploaded
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Detect PDF was uploaded

Started by dtobias, February 21, 2007, 06:27:20 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dtobias

Hello,

I need to be able to detect that the file uploaded was a PDF.  I have tried to use the is_document() function, but that does seem to apply to PDFs.  Is there a built in function to determine that the uploaded file was a PDF?

Thanks

Nibbler

is_document() should work for pdfs. If it doesn't then check if the mime type matches application/pdf

dtobias

Thanks for the quick reply.  How do I check the MIME type?  Is there a single function to call that will return the MIME type?

Thanks

Nibbler

Either call cpg_get_type(filename) or examine the filename for yourself.