<span style="font-size:14px;"><span style="white-space:pre"> </span>private File file;//文件
private String fileFileName;//文件名
private String fileContentType;//文件MIME类型</span>
1.第一步确定自己起的名字要和G:\higher class\code\01_struts_action\WebContent\WEB-INF\lib\commons-fileupload-1.3.2.jar该jar包支持的名字一致
<span style="font-size:14px;"><form action="${pageContext.request.contextPath }/upload/upload_uploadFile"
method="post" enctype="multipart/form-data">
<table border="1" width="50%">
<tr>
<td>选择文件:</td>
<td>
<input type="file" name="file"/>
</td>
</tr>
<tr>
<td>
<input type="submit" value="提交"/>
</td>
</tr>
</table>
</form></span>
2.确定自己的jsp页面form表单的method为post(因为是上传文件,不设置的话会默认是get),一定记住设置属性enctype="mutipart/form-data"(以二进制文件进行传输)。