1

I have used bulletproof php in the past for secure picture file uploads and trying recently for pdf and word files, it responded with an error message : 'Invalid File! Only (pdf, docx) image types are allowed', making me understand it will probably just handle image files as I couls still realise in the script here:

$doc_file = new Bulletproof**Image**($_FILES);

$doc_file->setMime(['pdf', 'docx']) ->setLocation('uploads');

I even did a fast search in the bulletproof.php file for the keyword 'pdf', but it returned nothing.

But researching online, some people seem to have used it for pdf file downloads but couldn't be more explicit about how, so I will like to know if there is someone here who has used it before please can you enlighten me or better still refer me to another library as good and simple to use as bulletproof php for file (word, pdf) uploads.

YowE3K
  • 23,852
  • 7
  • 26
  • 40
nkcho
  • 21
  • 5
  • 1
    I am the author of bulletproof. As it says in the readme it is only for uploading images. You can't upload pdf or anyother file. If you want to upload pdf files with it you have to modify the class, good thing is it will only take less than 5 mins – samayo Dec 18 '17 at 09:08
  • Wow, talking to the man himself, I appreciate your work. Ok any referrals on an already written script? If not, then I will modify it then try it and send you the script for proof-reading if you won't mind. – nkcho Dec 18 '17 at 12:45
  • thanks. I think this one is good. https://github.com/brandonsavage/Upload but it is not actively maintained but it should be good enough – samayo Dec 18 '17 at 12:50

0 Answers0