There's a project at my company which requires users to be able to almost-freely upload files to the server. There's some restrictions on file type, but more importantly we need a restriction on file size.
Most solutions we're finding to limit the file size involve uploading the document and then checking it size, deleting or acting upon it if the file size is bigger than allowed. Ideally, we would like a solution that constantly checks the uploaded size up until certain moment, and ignores the rest of the file and throws an error if the sum of the parts uploaded are bigger than allowed.
I think this must be possible as the uploading process takes part via a multipart request, but I'm having trouble finding info on how to do this. Any help would be greatly appreciated.
Thanks!