我单独只传文件是成功的,但是我再在传文件的页面加一些文件的标题、说明等文本框,再上传时上传后的文件名是Content-Disposition,而且大小是0.请问这是什么问题呢?
解决方案 »
- JAVA+CORBA
- 怎么样实现不刷新页面就能提交表单
- HttpClient
- csdn的上传文件时的进度条及上传速度什么的是怎么弄出来的呀,怎么获得这些信息值
- struts1.2 中如何将form传递给JSP页面或其他Action
- 怎么获得一个字符串的编码字符串
- 100分求 关于Spring注解管理MappingDispatchaction的管理方式??
- 菜鸟求救~~在线等
- 我是个初学者请帮帮小弟
- Jquery.form.js 上传图片时IE下拒绝访问form.submit() ,chrome、fox下正常 贵求各位大神帮忙解决,很急很急很急!!!
- 关于两个JSP分页的问题(一个是只显示10个分页,二是指定页码跳转)
- 为什么tomcat一闪而过,启动不了
<%@ page contentType="text/html;charset=GB2312" %>
<HTML>
<head>
<title>上传文件示例</title>
</head>
<BODY>
上传文件程序应用示例
<FORM action="do_upload.jsp" method="post" ENCTYPE="multipart/form-data">
请选择要上传的文件:<input type="file" name="upfile" size="50">
<INPUT type="submit" value="提交">
</FORM>
</BODY>
</HTML>
失败的是
<%@ include file="/admin/session.jsp" %>
<html>
<head>
<title>图片上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="/css/back.css" rel="Stylesheet" type="text/css" />
</head>
<body >
<FORM name="Myform" action="do_upload.jsp" method="post" ENCTYPE="multipart/form-data">
<table border=0 cellspacing=0 cellpadding=0 width="100%" >
<tr>
<td colspan="5" background="/admin/images/bground.png" height="27"><strong>当前位置:添加图片</strong></td>
</tr> <tr height="40"><td height="34"></td><td height="34"><input type="hidden" name="newsid" value="<%=request.getParameter("newsid")%>"></td>
<td rowspan="6" background="yellow" width="59%"><img border="1" width="160" id="preview" src="/admin/images/preview.gif"></td></tr>
<tr height="40"><td height="46"> 图片标题</td><td height="46">
<input type="text" name="title" class="InputStyle_1"><font color="#FF0000">*</font></td></tr>
<tr height="40">
<td width="13%"> 选择图片</TD>
<td width="27%">
<input type="file" name="upfile" size="50" class="InputStyle_1" onchange=setTimeout('preview()',100)><font color="#FF0000">*</font>
</td>
</tr>
<tr height="40">
<td width="13%"> 是否允许显示</td>
<td><input name="ishead" type="radio" value="0" checked>
是
<input type="radio" name="ishead" value="1" >
否</td>
</tr>
<tr height="40">
<td width="13%"> 所属分类</td>
<td>
<%
String sql="select type from news where id="+Integer.parseInt(request.getParameter("newsid"));
rs.executeSql(sql);
if (rs.next())
{
if (rs.getInt("type")==1)
out.println("a");if (rs.getInt("type")==2)
out.println("b");if (rs.getInt("type")==3)
out.println("c");
}
%>
<input type="hidden" name="kind" value="<%=rs.getInt("type")%>">
</td>
</tr>
<tr height="40">
<td></td><td><input type="submit" value="上传" name="B1" IsShowProcessBar="True" class="submit"></td>
</tr>
</table>
</form>
</body>
</html>而用的都是一个处理文件。