下面是我上传文件的一段代码,但是加上enctype属性做实验处理页面读不出title,date的值来,请问有什么办法吗
我想的是使用地址栏传参数的办法,但传中文参数乱码,网上有介绍用java.net.encoding(大概是这个类),但这的参数
是动态的,这样写不行啊!
<form method="post" action="do_upload.jsp" name="sub_form" enctype="multipart/form-data">
<table>
<tr><td>标题</td><td><input name="title" type="input" size="40"/></td></tr>
<tr><td>时间</td><td><input name="date" type="input" size="40"/></td></tr>
<tr><td>文件</td><td><input name="fileContent" type="file" size ="40"/></td></tr>
<tr colspan="2"><td><input type="button" value="提交" onclick="go()"/></td></tr> </table>
</form>
恳请指教,谢谢!!!!!!!
我想的是使用地址栏传参数的办法,但传中文参数乱码,网上有介绍用java.net.encoding(大概是这个类),但这的参数
是动态的,这样写不行啊!
<form method="post" action="do_upload.jsp" name="sub_form" enctype="multipart/form-data">
<table>
<tr><td>标题</td><td><input name="title" type="input" size="40"/></td></tr>
<tr><td>时间</td><td><input name="date" type="input" size="40"/></td></tr>
<tr><td>文件</td><td><input name="fileContent" type="file" size ="40"/></td></tr>
<tr colspan="2"><td><input type="button" value="提交" onclick="go()"/></td></tr> </table>
</form>
恳请指教,谢谢!!!!!!!
楼主【lfrsx】截止到2008-07-02 19:14:16的历史汇总数据(不包括此帖):
发帖的总数量:30 发帖的总分数:655
结贴的总数量:23 结贴的总分数:525
无满意结贴数:0 无满意结贴分:0
未结的帖子数:7 未结的总分数:130
结贴的百分比:76.67 % 结分的百分比:80.15 %
无满意结贴率:0.00 % 无满意结分率:0.00 %
楼主加油
加了这个之后,不能用普通的request读出来的,好像要用另一种方式读出来吧,g一下吧,应该有蛮多的相关内容
su.initialize( pageContext );
su.setMaxFileSize( 100*1024*1024 ); //100M文件上限
su.upload();
String title = su.getRequest().getParameter( "title" );
String date = su.getRequest().getParameter( "date" );
确实是可以的,这样写就可以了