问题描述
我想将文件作为InputStream
主体直接上传到JAX-RS POST
请求。但是默认情况下,该主体的大小限制为10MB,对于我的某些文件来说太小了。我找到了一个配置选项MAX_ENTITY_SIZE,但是如何在WildFly中进行设置?我在jboss-cli中什么都没找到。
解决方法
使用jboss-cli.sh,您将执行以下操作:
/subsystem=undertow/server=default-server/https-listener=https/:write-attribute(name=max-post-size,value=104857600)
(假设HTTPS),其中104857600现在为100MB左右。
这会将相应的standalone.xml
修改为:
<https-listener name="https" socket-binding="https" max-post-size="104857600" security-realm="ApplicationRealm" enable-http2="true"/>