Title: save image in upload folder
Last modified: August 31, 2016

---

# save image in upload folder

 *  [omidparkour](https://wordpress.org/support/users/omidparkour/)
 * (@omidparkour)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/save-image-in-upload-folder/)
 * Hi guys
    i want to create a field in user profile to upload image for use in 
   author page . and so i write the following codes but image url insert in database
   but photo can not be saved in upload folder please help me!
 *     ```
       add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
       add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
   
       function my_show_extra_profile_fields( $user ) { ?>
   
       <h3>Extra profile information</h3>
   
       <table class="form-table">
   
       <tr>
       <th><label for="Linkedin">Header Photo</label></th>
   
       <td>
       <input type="file" name="Header" id="Header" value="<?php echo esc_attr( get_the_author_meta( 'Header', $user->ID ) ); ?>" class="regular-text" />
       <span class="description">عکس هدر صفحه پروفایل خود را آپلود کنید</span>
       </td>
       </tr>
       </table>
       <?php }
       add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
       add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
   
       function my_save_extra_profile_fields( $user_id ) {
       $uploadUrl= wp_get_upload_dir();
       if ( !current_user_can( 'edit_user', $user_id ) )
       return false;
   
       /* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */
       update_usermeta( $user_id, 'Header', $uploadUrl['url']."/".$_POST['Header'] );
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [10 years, 1 month ago](https://wordpress.org/support/topic/save-image-in-upload-folder/#post-7443866)
 * Please don’t post in the Alpha/Beta forum unless you’re actually testing the 
   alpha/beta version of WordPress (not a plugin or a theme). Also, once WordPress
   has released a version, it’s not appropriate to post in alpha/beta and you should
   post in the How To & Troublshooting forum:
 * [https://wordpress.org/support/forum/how-to-and-troubleshooting](https://wordpress.org/support/forum/how-to-and-troubleshooting)
 * This post has been moved out for you.

Viewing 1 replies (of 1 total)

The topic ‘save image in upload folder’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/save-image-in-upload-folder/#post-7443866)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
