使用Spring 3.0的MultipartHttpServletRequest时的请求大小限制

我想知道如果我使用HTTP多部分内容类型在一个客户端的表单子目录中上载文件列表,那么大小限制是什么.

在服务器端,我使用
Spring的MultipartHttpServletRequest来处理请求.

mM问题:

>是否应该有不同的文件大小限制和总请求大小限制或文件大小是唯一的限制,并且请求能够将100个文件作为lonng上载,因为它们不是太大.
> Doest Spring请求包装器读取完整的请求并将其存储在JAVA堆内存中,或者存储它的temporaray文件以便能够使用大配额.
>使用在流中读取httpservlet请求是否会改变大小限制,而不是使用应用程序服务器一次性读取完整的http请求.
>这个过程的瓶颈是什么 – Java堆大小,运行我的Web服务器的文件系统的配额,我要保存文件的DataBase允许的最大BLOB大小是多少?或Spring内部限制?

仍然没有确切答案的相关主题:

> does-spring-framework-support-streaming-mode-in-mutlipart-requests
> is-there-a-way-to-get-raw-http-request-stream-from-java-servlet-handler
> how-to- drop-body-of-a-request-after-checking-headers-in-servlet
> apache-commons-fileupload-throws-malformedstreamexception

最佳答案 我查看了Spring CommonsMultipartResolver代码.它使用apache文件上传来解析多部分数据. CommonsMultipartResolver已将默认缓冲阈值设置为10kB,并使用DiskFileItemFactory创建FileItem.如果Stream大于10kB,则FileItem将写入磁盘.您还可以更改为存储库文件夹的位置,以存储临时上载的文件项.

Is there should be different file size limitation and total request size
limitation or file size is the only
limitation and the request is capable
of uploading 100s of files as lonng as
they are not too large.

我不知道您可以发送的多部分数据中的部件数量的最大限制或Spring CommonsMultipartResolver的限制,但因为它使用Apache FileUpload,我认为它们应该是相同的限制.我使用Apache FileUpload(没有Spring)来接收大于3GB的多部分流,它包含2个文件,20MB和3.6GB.虽然,我不能给你确切的限制,它应该能够处理几GB的流.

Doest the Spring request wrapper read the complete request and store it
in the JAVA heap memory or it store
temporaray files of it to be able to
use big quota.

正如我之前解释的那样,CommonsMultipartResolver使用Apache FileUpload. FileItem是使用DiskFileItemFactory创建的,因此FileItem暂时保存到磁盘. deafult记忆阈值是10kB.

Is the use of reading the httpservlet request in streaming would
change the size limitation than using
complete http request read at-once by
the application server.

对不起,我无法回答这个问题.流中的httpservlet请求和一次性读取http请求之间有什么不同?

What is the bottleneck of this process
– Java heap size, the quota of the filesystem on which my web-server
runs, the maximum allowed BLOB size
that the DataBase in which I am gonna
save the file alows? or Spring
internal limitations?

通用速度瓶颈可按以下顺序分类:网络 ibm,BLOB限制应为2GB.

我不知道Spring的内部限制.但Apache FileUpload应该能够毫无问题地处理几GB的流.

点赞