I suggest an alternative way, since doing it like this did not work for me either. Do this using event listeners :
yourbundle.oneuploadvalidatorlistener:
class: Amine\yourBundle\EventListener\oneupValidator
arguments: [%your_own_defined_maxBytes%]
tags:
- { name: kernel.event_listener, event: oneup_uploader.validation, method: onValidate }
, , , , oneup_uploader.motors.validation( , )
EventListener:
namespace Amine\yourBundle\EventListener;
class oneupValidator {
private $max_size;
function __construct($max_size) {
$this->max_size =$max_size;
}
function onValidate(ValidationEvent $event) {
$file = $event->getFile();
new ValidationException('error.max_size');
}
}
, .