Invalid file type when using wp_upload_bits to upload PDF to a custom post type
Ahh I figured it out. After echoing and print_r every single thing I could I figured out that this line: $uploaded_file = wp_upload_bits($_FILES[$pdf_field[‘name’]], null, file_get_contents($_FILES[$pdf_field[‘tmp_name’]])); Needed to be changed to this: $uploaded_file = wp_upload_bits($pdf[‘name’], null, file_get_contents($pdf[‘tmp_name’])); The original problem I had in the first place was not being able to pass my $_FILE array directly … Read more