commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Basil <peterbasil2...@gmail.com>
Subject [fileupload] Request empty with IE8
Date Mon, 28 May 2012 18:20:19 GMT

Hi All, 

I am using the Commons FileUpload package to upload a file to the server. 

I have executed my Servlet with Firefox, Chrome and Safari without any problem. 
But when I try with IE8, it fails as the request does not seems to contain the data and upload.parseRequest(request)
returns and empty List. 
I wonder whether I am missing anything. 

This is my code: 
____________________________________________
      
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {  
        response.setContentType("text/html");  
  
        String dFileName = null;  
        String basePath = getServletContext().getRealPath("/");  
        String propConfFile = basePath + "WEB-INF//" + PROP_CONF_FILE;  
        propUtil.load(propConfFile);  
                          
        // create file upload factory and upload servlet  
          FileItemFactory factory = new DiskFileItemFactory();  
          ServletFileUpload upload = new ServletFileUpload(factory);  
            
          List uploadedItems = null;  
          FileItem fileItem = null;  
          FileItem actualFileItem = null;  
            
          try {  
             uploadedItems = upload.parseRequest(request);  
             Iterator i = uploadedItems.iterator();  
      
             while (i.hasNext())  
             { …  
____________________________________________

I am running on apache-tomcat-7.0.27 and the libraries I am using are: commons-fileupload-1.2.2.jar,
commons-io-2.1.jar 

Many thanks in advance, 
Peter 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message