gpt4 book ai didi

java - Servlet MultipartConfig 参数

转载 作者:行者123 更新时间:2023-12-02 13:39:01 26 4
gpt4 key购买 nike

我正在阅读 MultipartConfig 的官方和非官方文档,但我不明白其参数的使用,特别是这些参数:

MaxFileSize: The maximum size allowed for uploaded files, in bytes. If the size of any uploaded file is greater than this size, the web container will throw an exception (IllegalStateException). The default size is unlimited.

fileSizeThreshold: The file size in bytes after which the file will be temporarily stored on disk. The default size is 0 bytes.

maxRequestSize: The maximum size allowed for a multipart/form-data request, in bytes. The web container will throw an exception if the overall size of all uploaded files exceeds this threshold. The default size is unlimited.

我认为 MaxFileSize 是最大文件大小的值,不是吗?但是...其他两个参数呢?谁能给我换句话解释一下?

谢谢!

最佳答案

fileSizeThreshold: The file size in bytes after which the file will be temporarily stored on disk. The default size is 0 bytes.

上传的文件可以驻留在服务器的内存中或存储到磁盘的某个临时位置,此设置是两种状态之间的阈值。

maxRequestSize: The maximum size allowed for a multipart/form-data request, in bytes. The web container will throw an exception if the overall size of all uploaded files exceeds this threshold. The default size is unlimited.

一个多部分请求可能包含一堆小文件,即总限制 = 所有上传文件大小的总和。

关于java - Servlet MultipartConfig 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42841820/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com