public function validate(UploadedFile $file)
    {
        foreach ($this->constraints as $constraint) {
            if (!$constraint->validate($file)) {
                throw new ConstraintException($constraint, $file);
            }
        }
        return true;
    }