Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here's the code I use :
$form['image'] = array(
'#type' => 'image_upload_element',
'#attributes' => array("enctype" => "multipart/form-data"),
'#title' => t('Image'),
'#image_preview_size' => '120x250',
'#file_validators' => array(
'file_validate_size' => array(10240),
'file_validate_extensions' => array('png gif jpg jpeg'),
),
);
As you can see on screen-shots attached, the upload is forbidden on IE6 but not on FF3.
Comments
Comment #1
Alan D. CreditAttribution: Alan D. commentedWere you logged in as admin user? (uid = 1)
The module is using core Drupal file size validation that allows the admin user to bypass the size restrictions:
Eg:
Comment #2
Simbud CreditAttribution: Simbud commentedOups ! True ! Didn't thought admin could bypass the limitation.
Thanks for your quick answer and for your useful module :)
Comment #3
Alan D. CreditAttribution: Alan D. commented;)