symfony/symfony — pull request #10850 by zhil (2014-05-03 19:10:06+00:00)
Title: [Validator] Ability to validate only uploaded files for Assert/File

| Q	| A |
| ---	| --- |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | N/A |
| License | MIT |
| Doc PR | no |

We use gaufrette filesystem mapped via SFTP and located very weird perfomance issue. We have such a code in our doctrine entities
```
* @Assert\File(
* maxSize="100M",
* mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/bmp", "image/gif"},
* )
public $file;
```
In background it check file each time we load entity. If we load 100 entities - validator do lot of the useless requests to remote server and page load speed decrease.

I have created small patch for this issue, what do you think about it?