I am working on a project that requires downloading files. I want to make sure that it is protected and only PDF files are uploaded. I am already checking the file extension, but I want to make sure that the file is really a PDF file.
What is the best way to check mime type in php? I am using PHP 5.2.5 and cannot get fileinfo or mime_content_type () to work.
for fileinfo, I keep getting the following:
Warning: finfo_open() [function.finfo-open]: Failed to load magic database
at '(null)'. in [snipped filename] on line 35
source
share