Let the client report the expected file size in the headers. The server side will abort if the size does not match after upload.