form设置enctype=multipart/form-data后,input怎么获得value
展开全部
今天写程序的时候遇到一个问题:form表单设置method="post" enctype="multipart/form-data"做上传文件时, request就取不到参数了,但是可以获得到文件。代码是这样的:
[html] view plain copy
<form id="upload" name="upload" action="fileftp.jsp" method="post" ENCTYPE="multipart/form-data">
<input type="hidden" name="otherName" id="otherName" value="abcdefg"/>
<td nowrap>
<input type="file" id="file1" name="file1" value="" size="40" class="sbttn"/>
<input type="submit" value="上传" class="sbttn"/>
</td>
</form>
[html] view plain copy
<form id="upload" name="upload" action="fileftp.jsp" method="post" ENCTYPE="multipart/form-data">
<input type="hidden" name="otherName" id="otherName" value="abcdefg"/>
<td nowrap>
<input type="file" id="file1" name="file1" value="" size="40" class="sbttn"/>
<input type="submit" value="上传" class="sbttn"/>
</td>
</form>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询