Title: Upload function does not work
Last modified: August 31, 2016

---

# Upload function does not work

 *  [onirisweb](https://wordpress.org/support/users/onirisweb/)
 * (@onirisweb)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/upload-function-does-not-work/)
 * Hi,
 * I’m desperately trying to implement upload avatar field in my registration page:
   [http://revedevoile.com/enregistrer/](http://revedevoile.com/enregistrer/)
 * For that I used your documentation and added this function in my function.php
   file :
 *     ```
       function my_avatar_filter() {
         // Remove from show_user_profile hook
         remove_action('show_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
         remove_action('show_user_profile', array('wp_user_avatar', 'wpua_media_upload_scripts'));
   
         // Remove from edit_user_profile hook
         remove_action('edit_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
         remove_action('edit_user_profile', array('wp_user_avatar', 'wpua_media_upload_scripts'));
   
         // Add to edit_user_avatar hook
         add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_action_show_user_profile'));
         add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_media_upload_scripts'));
       }
   
       // Loads only outside of administration panel
       if(!is_admin()) {
         add_action('init','my_avatar_filter');
       }
       ```
   
 * Then in my registration page, I added this hook :
 * `<?php do_action('edit_user_avatar', $current_user); ?>`
 * But whenever I choose an image with acceptable file size and click on upload 
   button, the page refreshes and no image has been uploaded.
 * Could you explain me how to solve this issue ? Did I made something wrong ?
 * Thanks for your help,
 * Cedric
 * [https://wordpress.org/plugins/wp-user-avatar/](https://wordpress.org/plugins/wp-user-avatar/)

The topic ‘Upload function does not work’ is closed to new replies.

 * ![](https://ps.w.org/wp-user-avatar/assets/icon-256x256.png?rev=2532486)
 * [Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress](https://wordpress.org/plugins/wp-user-avatar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-user-avatar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-user-avatar/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-user-avatar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-user-avatar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-user-avatar/reviews/)

## Tags

 * [Classipress](https://wordpress.org/support/topic-tag/classipress/)

 * 0 replies
 * 1 participant
 * Last reply from: [onirisweb](https://wordpress.org/support/users/onirisweb/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/upload-function-does-not-work/)
 * Status: not resolved