Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Detect PDF was uploaded  (Read 2476 times)

0 Members and 1 Guest are viewing this topic.

dtobias

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Detect PDF was uploaded
« on: February 21, 2007, 06:27:20 pm »

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
Logged

Nibbler

  • Guest
Re: Detect PDF was uploaded
« Reply #1 on: February 21, 2007, 06:31:54 pm »

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

dtobias

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Detect PDF was uploaded
« Reply #2 on: February 21, 2007, 09:58:05 pm »

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
Logged

Nibbler

  • Guest
Re: Detect PDF was uploaded
« Reply #3 on: February 21, 2007, 10:39:50 pm »

Either call cpg_get_type(filename) or examine the filename for yourself.
Logged
Pages: [1]   Go Up
 

Page created in 0.072 seconds with 27 queries.