Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-11752

Add ability to mass/bulk upload user profile images



    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Administration
    • Labels:
    • Affected Branches:
    • Fixed Branches:


      Since Moodle development is looking at user images I thought it might be a convenient time to add a feature request for administrators to be able to mass or bulk upload user profile images. This is particularly helpful in schools that receive school pictures from a photographer. The admins would be able to copy the files to a particular directory and have Moodle process those images into the user profile. A previous hack that I did accomplished this by modifying the /lib/gdlib file and creating a second save_profile_image function that took the filename as input for a filename rather than using the upload manager. I would think that the function could be fairly easily modified to detect file or upload manager. I am attaching a patch that Iñaki submitted for Moodle 1.8.2 (prior to the change in the location of files as related to MDL-8605). An updated patch file is to follow for 1.8+ and 1.9. For increased flexibility, it might be worth considering creating a CFG->uploadprofilepath to the path the the user profile images are stored (I had hardcoded mine to be /userpix/jpg but something like /userpix/import could work as well) and an option for CFG->uploadprofilename to determine whether to use the user's username, Moodle id, or idnumber as the name of the file (or any other field that could uniquely identify the user).

      See http://moodle.org/mod/forum/discuss.php?d=36405 for the discussion.

      I have also included my patch of the /lib/gdlib.php file (also 1.8.2, i.e. pre MDL-8605) that shows the changes I made to use a filename. This can be a real time saver for system administrators at schools and hopefully is fairly easy to accomplish. Peace - Anthony


        1. gdlib.php.diff
          4 kB
          Anthony Borrow
        2. mass-upload-user-pictures-1.8.2.tar.gz
          5 kB
          Anthony Borrow
        3. mass-upload-user-pictures-1.8.3.diff
          18 kB
          Iñaki Arenaza
        4. mass-upload-user-pictures-1.8.3.diff
          17 kB
          Iñaki Arenaza
        5. mass-upload-user-pictures-1.8.3.tar.gz
          8 kB
          Iñaki Arenaza
        6. mass-upload-user-pictures-1.8.3.tar.gz
          8 kB
          Iñaki Arenaza
        7. mass-upload-user-pictures-1.8.7.diff
          19 kB
          Iñaki Arenaza
        8. mass-upload-user-pictures-1.9beta2.diff
          16 kB
          Iñaki Arenaza
        9. mass-upload-user-pictures-1.9beta2.tar.gz
          8 kB
          Iñaki Arenaza
        10. mass-upload-user-pictures-1.9beta3.diff
          17 kB
          Iñaki Arenaza
        11. mass-upload-user-pictures-1.9beta3.tar.gz
          9 kB
          Iñaki Arenaza
        12. mass-upload-user-pictures-1.9beta4.diff
          17 kB
          Iñaki Arenaza

          Issue Links



              aborrow Anthony Borrow
              aborrow Anthony Borrow
              Nicolas Connault
              Component watchers:
              Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              5 Vote for this issue
              4 Start watching this issue


                Fix Release Date: