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

Improve the list of maximum file size options for file uploads

    XMLWordPrintable

Details

    • MOODLE_25_STABLE, MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-42266_m33v2
    • Easy
    • Hide
      1. Edit the post_max_size and upload_max_filesize to be larger than 8GB. (Note, you may need to increase your max execution time from the default see: https://docs.moodle.org/32/en/File_upload_size#Restricting_the_File_size_-_how_it_works for more information)
      2. Navigate to Site administration -> security ->site policies and verify that the 'maxbytes' setting has options for 250MB, 500MB, 750MB, 1GB, 2GB, 4GB, and 8GB along with the site default.
      3. Set the 'maxbytes' to 250MB
      4. Set the 'userquota' to be larger than 250MB
      5. Log in as someone other than admin
      6. Navigate to the dashboard and use the private files block to add a file that is between 100MB and 250MB and verify that it uploads.
      7. Try to upload a file over 250MB (but less than the user quota you've allocated) and verify that it does not upload.
      8. Log back in as admin
      9. Edit the php.ini and set the post_max_size and upload_max_filesize values to 1.5GB.
      10. Restart your web server.
      11. Navigate again to Site administration > Security > Site policies and check the maxbytes setting.
        • Confirm that the options go only up to 1.5GB.
      Show
      Edit the post_max_size and upload_max_filesize to be larger than 8GB. (Note, you may need to increase your max execution time from the default see: https://docs.moodle.org/32/en/File_upload_size#Restricting_the_File_size_-_how_it_works for more information) Navigate to Site administration -> security ->site policies and verify that the 'maxbytes' setting has options for 250MB, 500MB, 750MB, 1GB, 2GB, 4GB, and 8GB along with the site default. Set the 'maxbytes' to 250MB Set the 'userquota' to be larger than 250MB Log in as someone other than admin Navigate to the dashboard and use the private files block to add a file that is between 100MB and 250MB and verify that it uploads. Try to upload a file over 250MB (but less than the user quota you've allocated) and verify that it does not upload. Log back in as admin Edit the php.ini and set the post_max_size and upload_max_filesize values to 1.5GB. Restart your web server. Navigate again to Site administration > Security > Site policies and check the maxbytes setting. Confirm that the options go only up to 1.5GB.

    Description

      Hi,

      For the different "Upload file size" list around Moodle (site, course, assignment, etc.), instead of having the list hardcoded into Moodle, what do you think of allowing admins to select the values they wish to use? If they want to get rid of all the little Kb values, or add a 256Mb,etc. they would be able.

      I track down the size list in /lib/moodlelib.php, function get_max_upload_sizes:

      $sizelist = array(10240, 51200, 102400, 512000, 1048576, 2097152,
      5242880, 10485760, 20971520, 52428800, 104857600);

      Or maybe a new override in CONFIG?

      Any way where I don't need to hack into the code would be good actually.

      Attachments

        Issue Links

          Activity

            People

              sbourget Stephen Bourget
              jackdaniels JD
              Jun Pataleta Jun Pataleta
              Andrew Lyons Andrew Lyons
              Ryan Wyllie Ryan Wyllie
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/May/17