I need to compose a spring controller (server side of course) for uploading files - when I get the file I need to run some validations. The thing is - my clients may try to upload some really big file and I would like to run this validation based on a meta data they will supply.
What is the best practice for this? What should be the resource they should run the validation against?
For example, the file resource may seem like this:
POST .../files
GET .../files/{id} or ../files to get all
DELETE ../files/{id}
Of course the validation will be in each method - but as I said before, I would like to enable the client to run the validation in a decoupled manner.
Thanks