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
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
Share Improve this question asked Oct 12, 2012 at 6:35 neerajneeraj 1113 bronze badges2 Answers
Reset to default 1You 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
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');
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745359543a4624296.html
评论列表(0条)