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

Drag n drop upload do not show correct warning message when the size of the file is to big

XMLWordPrintable

    • MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_28_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MDL-44626-master
    • Hide
      1. Decrease your php's post_max_size to something fairly small (56K?)
      2. Decrease your php's upload_max_filesize to something fairly small (128K?)
      3. Find a testfile (testfile1) which is larger than 56K and smaller than 128K
      4. Find a testfile (testfile2) which is large than 128K
      1. Navigate to a course and turn editing on
      2. Attempt to dndupload testfile1
        1. Confirm that you were told that the file was too large
      3. Attempt to dndupload testfile2
        1. Confirm that you were told that the file was too large
      4. Navigate to your private files
      5. Attempt to dndupload testfile1
        1. Confirm that you were told that the file was too large
      6. Attempt to dndupload testfile2
        1. Confirm that you were told that the file was too large
      7. Swap the post_max_size and upload_max_filesize and repeat.
      Show
      Decrease your php's post_max_size to something fairly small (56K?) Decrease your php's upload_max_filesize to something fairly small (128K?) Find a testfile (testfile1) which is larger than 56K and smaller than 128K Find a testfile (testfile2) which is large than 128K Navigate to a course and turn editing on Attempt to dndupload testfile1 Confirm that you were told that the file was too large Attempt to dndupload testfile2 Confirm that you were told that the file was too large Navigate to your private files Attempt to dndupload testfile1 Confirm that you were told that the file was too large Attempt to dndupload testfile2 Confirm that you were told that the file was too large Swap the post_max_size and upload_max_filesize and repeat.

      To reproduce:

      • As admin go to the gradebook import of a course.
      • Try to drag n drop a file in the filepicker of any of the import format.

      If the size is to big (Bigger than the post_max_size directive in php.ini), The warning message displayed is: "A required parameter (sesskey) was missing".

      You can also reproduce it when adding a file resource.

      It turns out that there are two issues here:

      1. The file manager does not get passed the true maxbytes value for those with a particular capability. In this case, the value `-1` (meaning unlimited) is passed. As a result, the file-size check is unable to compare the size of file being uploaded to the max size and reject files; and
      2. when those files are then passed to the upload script, php cuts off all parameters because they are large than the post_max_size directive. Because the sesskey check comes before any check for presence of a file, a message about incorrect sesskey is instead shown.

            dobedobedoh Andrew Lyons
            leblangi Gilles-Philippe Leblanc
            Simey Lameze Simey Lameze
            Dan Poltawski Dan Poltawski
            Ryan Wyllie Ryan Wyllie
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.