Extract file validation method
Add getJsonOptions to JsonResponse
Move getter above setter.
fix conflicts.
Merge pull request #5818 from lucasmichot/4.2-request-isvalidfile

[4.2] Request : extract file validation method
Fixing conflicts.