PDF file upload issue

I am using a plugin custom contact form where i have kept a file upload field at the front end. But when i try to upload a pdf file then neither tmp_name nor type property of $_FILES is being set. However other files like jpg/gih are being uploaded.

Need urgent help

Related posts

Leave a Reply

2 comments

  1. You should set your MIME types for your pdf.
    ‘application/pdf’ and/or ‘application/x-pdf’

    sorry for the quick answer, no time to go into detail but this should get you on the way

  2. expand the list of available file types for upload

    function add_pdf_mime_type($mimes) {
    
                            $mimes['pdf'] = 'application/pdf';
    
                            return $mimes;
    }  
    add_filter('upload_mimes', 'add_pdf_mime_type');