symfony/symfony — pull request #10917 by csarrazi (2014-05-16 15:03:43+00:00)
Title: [Validator] Added option for specifying the size format for the File validator

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | yes
| BC breaks? | yes and no, as the current calculation is not consistent
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10648
| License | MIT
| Doc PR | -

This lets someone choose between binary (multiples of 1024) and decimal (multiple of 1000) formats for specifying the size.

Example:

```php
use Symfony\Component\Validator\Constraints as Assert;

class Curriculum
{
/**
* @Assert\File(size=2000, sizeFormat="decimal")
*/
public $file;
}
```

By default, the size format is in binary.