I have several image and file fields in a D7.16 installation. The PHP file upload limit is 64MB, and files up to this limit are stored without any problem.
When I set a limit to "Maximum upload size", for example "1 MB" or "450 KB", this limit is ignored. I still can upload much bigger images and files, without any warning. This happens to all file and image fields in the installation. Tested on another server and D7.16 installations as well: same behaviour.

  • Drupal 7.16
  • Affects all image and file fields
  • No errors in Edit page
  • No errors in the Recent log messages

Comments

Tor Arne Thune’s picture

Status: Active » Postponed (maintainer needs more info)

Are you uploading the files as user 1? This user is exempt from file size validation. I've burned myself on this in the past.

jurveen’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Thank you! Yes, I was logged in as user 1. I've tested file uploads with a regular admin account, and the file limits work as expected. Thank you for helping me out.
By the way, is this documented? Couldn't find anything in the Drupal forums.

monish_deb’s picture

The validation was performed under includes/file.inc(function:file_validate_size) where condition has been purposely set for regular user (not 1).