一个上传文件的功能,老提示isMultipartContent(request) 为flase,请问什么原因?
不罗嗦 直接发部分代码前台页面代码<form name="postForm" action="paeaReportExample.do?method=addPaeaReportExample" enctype="multipart/form-data" method="post"> 
<table bgcolor="ece9d8" width="100%" border="0" cellpadding="1"
cellspacing="1" align="center">
<tr height=25>
<td 
style="color:ffffff;background: url(<%=Parameters.pathPrefix%>images/subnav_bkgd.gif)"
bgcolor="#0080c0">
<img style='margin-bottom:-3px'  src="<%=Parameters.pathPrefix%>images/tb.gif">
填写案例档案表信息
</td>
<td  colspan=4 align="left" style="background: url(<%=Parameters.pathPrefix%>images/subnav_bkgd.gif)"
bgcolor="#0080c0">
<input class="ouu" type=button value="  保存"
onclick="_submitForm(postForm)"
style="background: url(<%=Parameters.pathPrefix%>images/187_1.gif) no-repeat; background-position:5px 1; background-color: #7eaaed">
<input class="ouu" type=button value="  返回"
onclick="window.close()"
style="background: url(<%=Parameters.pathPrefix%>images/100_2.gif) no-repeat; background-position:5px 1; background-color: #7eaaed">
</td> </tr>
<tr height=5><td colspan="4"></td></tr>
  <tr>
<td align=right bgcolor="cacaca">
标题:<font color=red>*</font>
</td>
<td bgcolor="dedede" width="200">
<input type="text" name="name" style="width: 160px">
  </td>
</tr>
<tr height=5><td colspan="4">&nbsp;</td></tr>
  <tr>
<td align=right bgcolor="cacaca">
选择文件:<font color=red>*</font>
</td>
<td bgcolor="dedede" width="200">
 <input type="file" name="upload" size="50">
  </td>
</tr>
   </table>
  </form> 
private void upload(HttpServletRequest request,String uploadPath) throws Exception {  
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");  
        File tmpDir = new File("d://temp"); //初始化上传文件的临时存放目录,必须是绝对路径  
        try {  
         System.out.println("---ServletFileUpload.isMultipartContent(request)---"+ServletFileUpload.isMultipartContent(request));
            if (ServletFileUpload.isMultipartContent(request)) {  
                DiskFileItemFactory factory = new DiskFileItemFactory();  
                //指定在内存中缓存数据大小,单位为byte,这里设为1Mb   
                factory.setSizeThreshold(1 * 1024 * 1024);   
                //设置一旦文件大小超过getSizeThreshold()的值时数据存放在硬盘的目录   
                factory.setRepository(tmpDir);   
                ServletFileUpload sfu = new ServletFileUpload(factory);  
                 // 指定单个上传文件的最大尺寸,单位:字节,这里设为5Mb   
                sfu.setFileSizeMax(5 * 1024 * 1024);  
                //指定一次上传多个文件的总尺寸,单位:字节,这里设为10Mb   
                sfu.setSizeMax(10 * 1024 * 1024);   
                sfu.setHeaderEncoding("UTF-8"); //设置编码,因为我的jsp页面的编码是utf-8的   
                FileItemIterator fii = sfu.getItemIterator(request);// 解析request请求   
                uploadPath = uploadPath + "upload//"; // 选定上传的目录此处为当前目录  
                if (!new File(uploadPath).isDirectory()){  
                    new File(uploadPath).mkdirs(); //选定上传的目录此处为当前目录,没有则创建   
                }  
                  
                int index = 0;  
                while (fii.hasNext()) {  
                    FileItemStream fis = fii.next();// 从集合中获得一个文件流   
                    if (!fis.isFormField() && fis.getName().length() > 0) {// 过滤掉表单中非文件域   
                        String fileName = fis.getName().substring(  
                                fis.getName().lastIndexOf("."));// 获得上传文件的文件名   
                        fileName = sdf.format(new Date())+"-"+index+fileName;  
                        BufferedInputStream in = new BufferedInputStream(fis.openStream());   
                        BufferedOutputStream out = new BufferedOutputStream(  
                                new FileOutputStream(new File(uploadPath + "//" + fileName)));  
                        Streams.copy(in, out, true); // 开始把文件写到你指定的上传文件夹   
                        index++;  
                    }  
                }  
  
            }  
        } catch (Exception e) {  
            e.printStackTrace();  
        }  
    }