NutzCN Logo
问答 上传图片大小限制问题
发布于 2995天前 作者 miamiby557 1792 次浏览 复制 上一个帖子 下一个帖子
标签:
@At
	@AdaptBy(type=UploadAdaptor.class,args={"${app.root}/WEB-INF/tmp/user_photo", "8192", "utf-8", "20000", "102400"})
	@POST
	public Object addAppUserSave(@Param("file")TempFile tf,HttpServletRequest request){

对应jsp

<tr>
											 	<td>选择头像</td>
											 	<td colspan="3"><input type="file" name="file"/></td>
											</tr>

提交服务器

Nutz: Error@/appuser/addAppUserSave :
org.nutz.mvc.upload.UploadOutOfSizeException: File '人头.jpg' out of size!
	at org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:170)
	at org.nutz.mvc.upload.UploadAdaptor.getReferObject(UploadAdaptor.java:179)
	at org.nutz.mvc.upload.UploadAdaptor.getReferObject(UploadAdaptor.java:1)
	at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:211)
	at org.nutz.mvc.upload.UploadAdaptor.adapt(UploadAdaptor.java:117)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:182)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
3 回复

看UploadAdaptor的构造方法

来自炫酷的 NutzCN

@wendal

@AdaptBy(type = UploadAdaptor.class, args = { "${app.root}/WEB-INF/tmp/user_avatar", "8192", "utf-8", "20000","102400" })

第五个参数是什么意思

看UploadAdaptor的构造方法

添加回复
请先登陆
回到顶部