← Back to team overview

mahara-contributors team mailing list archive

[Bug 1268802] Re: Uploading more than php config max_file_uploads causes warning not displayed to user

 

Unfortunately it appears to be impossible to detect this error from
within PHP. It happens at line 0, before any processing happens in the
PHP script itself, and the end result is that the request proceeds, but
$_FILES simply truncates the list of files down to the legal amount.

We can work around it in Javascript though. The simple approach would be
to detect the max_file_uploads value, pass it to JS, and throw an
error/warning if the user tries to upload more files than that.

The more thorough approach, would be to send the files in multiple
requests. Javascript is already involved in the file uploader -- as soon
as you select some files, it submits a request to the uploader. Just
make it so that we pass max_file_uploads to the Javascript, and if
you're trying to upload more files than that, it splits it up into
multiple requests.

** Description changed:

+ If you try to upload more files than the number set for your php.ini
+ "max_file_uploads" setting, the upload silently fails for the remaining
+ files. Their progress spinner keeps spinning forever, and this message
+ is printed to the system PHP error logs but is not displayed within
+ Mahara:
+ 
  [Tue Jan 14 14:16:51 2014] [error] [client 10.22.33.88] PHP Warning:
  Maximum number of allowable file uploads has been exceeded in Unknown on
  line 0, referer: http://mahara/artefact/file/index.php
+ 
+ Note that this only happens if you click the old-fashioned file select
+ button. On the other hand, if you use the new drag-and-dropper, it sends
+ each file in a separate request and you don't encounter this problem.

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1268802

Title:
  Uploading more than php config max_file_uploads causes warning not
  displayed to user

Status in Mahara ePortfolio:
  Triaged

Bug description:
  If you try to upload more files than the number set for your php.ini
  "max_file_uploads" setting, the upload silently fails for the
  remaining files. Their progress spinner keeps spinning forever, and
  this message is printed to the system PHP error logs but is not
  displayed within Mahara:

  [Tue Jan 14 14:16:51 2014] [error] [client 10.22.33.88] PHP Warning:
  Maximum number of allowable file uploads has been exceeded in Unknown
  on line 0, referer: http://mahara/artefact/file/index.php

  Note that this only happens if you click the old-fashioned file select
  button. On the other hand, if you use the new drag-and-dropper, it
  sends each file in a separate request and you don't encounter this
  problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1268802/+subscriptions


References