我用fileupload做的上传,其中是从主页面到上传页面,我在上传页面,单击后退返回主页面的时候,tomcat报错,希望高手指点迷津!很是郁闷啊!
主要错误为:org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
主要错误为:org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
<%@page contentType="text/html; charset=GB2312"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<html:html>
<!--
The most important part is to declare your form's enctype
to be "multipart/form-data", and to have an html:file
element that maps to your ActionForm's FormFile property
-->
<html:form action="/List/File.do" method="POST" enctype="multipart/form-data">
<table width="790" align="center" cellspacing="1" cellpadding="0" border="0">
<tr>请选择你需要备份的文件:</tr><p> </p>
<tr><html:file property="file" value="浏览"/> <br/><br/></tr>
<html:submit value="提交" style="bg"/>
</table >
</html:form>
<p>
<table width="790" align="center" cellspacing="1" cellpadding="0" border="0">
<logic:notEmpty name="fileForm" property="fname"> 你已经备份的文件:
<p>
<ul>
<li>文件名称 :<bean:write name="fileForm" property="fname"/>
<li>文件大小 :<bean:write name="fileForm" property="size"/>
</ul>
</logic:notEmpty>
</table></html:html>