Title: Trouble Uploading with PHP
Last modified: July 31, 2023

---

# Trouble Uploading with PHP

 *  [baddon250](https://wordpress.org/support/users/baddon250/)
 * (@baddon250)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/trouble-uploading-with-php/)
 *     ```wp-block-code
       $profile_photo = "UPLOAD_DIR/photos/12345.jpg"
               $file_info = array(
                   'name'     => ($profile_photo),
                   'type'     => $wp_check_filetype['type'],
                   'tmp_name' => $profile_photo,
                   'error'    => 0,
                   'size'     => filesize($temp_file_path),
               );
   
               $uploaded = UM()->uploader()->upload_image($file_info, $user_id, 'profile_photo');
       ```
   
 * I’m having trouble with this code and I can’t get it to work, I keep getting 
   an error saying it’s the incorrect mime type, but I’ve verified the mime type
   is being set to ‘image/jpeg’ and I don’t know why it’s not working. The photo
   is already on the server at this point, and I need to use the ultimate member
   uploader to get it to the user’s profile.
 * _[ [Please do not bump.](https://wordpress.org/support/guidelines/#do-not-bump-posts)]_

The topic ‘Trouble Uploading with PHP’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [baddon250](https://wordpress.org/support/users/baddon250/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/trouble-uploading-with-php/)
 * Status: not resolved