文件的上传
表单
<form action="up" method="post" enctype="multipart/form-data">
用户名<input type="text" name="username"/><br>
照片<input type="file" name="zhaopian"/>
<input type="submit" value="上传">
Servlet
3步曲
DiskFileItemFactory factory = new DiskFileItemFactory() ;
ServletFileUpload sfu = new ServletFileUpload(factory) ;
try {
List<FileItem> listfile =sfu.parseRequest(request);