I'm trying to restrict the weight of the uploaded file in admin, I found the 'maxFileSize' in Magento documentation but it's not working :
$fieldset->addField( 'files', 'file', [ 'name' => 'file', 'label' => __('File'), 'title' => __('File'), 'maxFileSize' => 2097152, 'required' => false, 'note' => 'File size must be less than 2 Mb.' ] ); Thanks !