I am trying to transfer (large) files via HTTP to a database. I use Tomcat and Jersey as a Webframework. I noticed that if I send the file to my resource, the file is first buffered to disk (in temp \ MIME * .tmp) before it is processed in my doPOST method.
This is really an undesirable behavior because it doubles disk I / O and also leads to incorrect UX, because if the browser is already loaded, the user needs to wait a few minutes (depending on the file size, of course) until he receives an HTTP response.
I know that this is probably not the best implementation of a large file download (since you donโt even have the ability to resume), but also the requirements.: /
So my questions are: if there is a way to disable (disk) buffering for MULTIPART POST. Meme buffering is obviously too expensive, but I donโt see the need for disk buffering at all? (Explain please) How do large sites such as YouTube handle this situation? Or, at least, is there a chance to give the user immediate feedback if the file is sent? (It should be bad, as there might be something like SQLException)
source share