这是我的代码:
<form name="form" id="form" enctype="mutipart/form-data"
action="imageResize.jsp" method="post">
<input type="file" name="file"/>
<input type="submit" value="提交" />
</form>目标jsp:
<jsp:useBean id="smart" scope="page" class="com.jspsmart.upload.SmartUpload"/>
<%
smart.initialize(pageContext);
smart.upload();
smart.getFiles().getFile(0);
%>在smart.getFiles().getFile(0)这里报错,发现smart.getFiles()的长度为0,大家都说没有设置enctype="mutipart/form-data",可是我设置了啊,怎么还会有这个错啊!!!
<form name="form" id="form" enctype="mutipart/form-data"
action="imageResize.jsp" method="post">
<input type="file" name="file"/>
<input type="submit" value="提交" />
</form>目标jsp:
<jsp:useBean id="smart" scope="page" class="com.jspsmart.upload.SmartUpload"/>
<%
smart.initialize(pageContext);
smart.upload();
smart.getFiles().getFile(0);
%>在smart.getFiles().getFile(0)这里报错,发现smart.getFiles()的长度为0,大家都说没有设置enctype="mutipart/form-data",可是我设置了啊,怎么还会有这个错啊!!!
解决方案 »
- http status 500 java.lang.NullPointerException
- 请教:关于javamail中imap下载附件的问题
- 请教:一个正则表达式如何写,多谢!!
- 刷新一次占用一个数据源连接???(小弟不到10分,所以也给了多少分,请大家帮帮忙。。)
- 问大家一个很基础的问题
- 下载时不跳出打开,保存窗口,而是直接打开,该怎么设置?
- 请教一个prototype框架下的ajax取值问题
- 中文转换问题!急。。。
- tomcat4.1+iis5如何配置?论坛里的全是关于tomcat3.2的文章?
- 关于tomcat的问题,急
- mysql 存对象
- B/S 用MSCOMM32.OCX 驱动串口,向顾客显示屏传输数据
IE8下面的<input type='file' name='myfile' />
完整的路径名称要用滤镜来(js端)获取。
你搜索下:IE8 file文件名 或者 fackpath 就知道了。