Does Spring Framework support streaming in multi-user requests?

I don't see any indication in the Spring documentation that it supports reading files in streaming mode in its MultipartHttpServletRequest object, which handle multipart requests.

similarly, which is possible in the Apache Commons framework .

Is it supported in Spring at all?

+3
source share
1 answer

Yes, look here . Your Spring API is too old. In addition, Streaming mode has nothing to do with Spring. This is a feature of your servlet container or your server. Most servers now support streaming mode. The servlet will start executing the request as soon as it receives the header from your request. You can continue to send the stream of your request body (for example, multi-page data). However, parsing can only be performed completely when the request is sent completely. This is the same as Apache Common FileUpload.

Alternatively, you can write a controller using the Spring annotation. Spring will introduce ServletRequest if you add this as one of your controller processing actions. After that, you can use Apache FileUpload for multiple parsing.

You cannot perform selective parsing because the request must be completely sent to the server no matter what. This is the limit of Http. A few days ago I asked a question .

+1
source

Source: https://habr.com/ru/post/1333677/