How to check if uploaded file is .pdf not .jpeg?
I like to use the following: First I initiate an array of supported mime types: $supportedTypes = array( ‘application/pdf’ ); Next I get my actual uploaded file type: $fileType = $_FILES[‘type’][0] Then I use wp_check_filetype() to get the extension and mimetype: $fileArray = wp_check_filetype( basename( $_FILES[‘name’][0] ) ); Finally I run a conditional to make … Read more