title: jsf file uploading issue in IE9
body: <p>i am using jsf2.0 with primefaces.. In my application i have image uploading option. The file upload work fine all the browsers except IE9.. when i try to upload the file on IE9 i is not getting uploaded, and i am getting the following error.</p>
  
  <p>Stack trace</p>
  
  <pre><code>java.io.FileNotFoundException: D:\Eclipse_wspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ChennaiVolunteer\activityPhoto\C:\Users\Public\Pictures\Sample Pictures\Desert.jpg (The filename, directory name, or volume label syntax is incorrect)
  at java.io.RandomAccessFile.open(Native Method)
  at java.io.RandomAccessFile.&lt;init&gt;(Unknown Source)
  at javax.imageio.stream.FileImageOutputStream.&lt;init&gt;(Unknown Source)
  at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(Unknown Source)
  at javax.imageio.ImageIO.createImageOutputStream(Unknown Source)
  at javax.imageio.ImageIO.write(Unknown Source)
  at com.chennaivolunteer.photo.upload.PhotoUploadAction.handleImage(PhotoUploadAction.java:188)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
  at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
  at org.apache.myfaces.view.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:83)
  at org.primefaces.component.fileupload.FileUpload.broadcast(FileUpload.java:298)
  at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:937)
  at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:269)
  at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1249)
  at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:682)
  at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:34)
  at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
  at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:77)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
   Aug 8, 2012 2:24:16 PM org.apache.catalina.core.StandardWrapperValve invoke
  </code></pre>
  
  <p>SE</p>
  
  <p>my image.xhtml is</p>
  
  <pre><code>&lt;f:view&gt;
          &lt;h:form  enctype="multipart/form-data"&gt;
              &lt;p:panel  header="Event Images" style="font-size:12px;height:499px"&gt;
              &lt;h:inputHidden value="#{photoUploadAction.aid}"&gt;&lt;/h:inputHidden&gt;
              &lt;p:messages id="messages" for="imaload"&gt;&lt;/p:messages&gt;       
               &lt;p:fileUpload id="imaload" fileUploadListener="#{photoUploadAction.handleImage}"  
                             mode="advanced"  multiple="true"
                            update="messages"  
                             immediate="true"  
                             allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/&gt;  
                   &lt;!--  &lt;p:growl life="1000"  id="messages"/&gt;  --&gt; 
              &lt;/p:panel&gt;
          &lt;/h:form&gt;
      &lt;/f:view&gt;
  </code></pre>
  
  <p>and my backing bean method is</p>
  
  <pre><code>    public void handleImage(FileUploadEvent event) throws IOException {
          BufferedImage bufferedImage;
          // setAid(getAid());
  
          String tmpFile = scontext.getRealPath(("/activityPhoto/")
                  + event.getFile().getFileName());
  
          //File realPath = new File("e:/cv_project/ChennaiVolunteer/WebContent/activityPhoto",(event.getFile().getFileName()));
          File realPath = new File("d:/Program Files (x86)/Apache Software Foundation/Tomcat 7.0/webapps/ChennaiVolunteer/activityPhoto",(event.getFile().getFileName()));
  
          String filName = realPath.toString();
  
          /*File result = new File(tmpFile);
  
          String exactPath = result.toString();
  */
          byte[] imageByte = event.getFile().getContents();
  
          boolean flag = false;
  
          //storeImage(imageByte, tmpFile);
  
          String images = event.getFile().getFileName();
          photoUploadVO.setImageName(images);
  
          imageName = photoUploadVO.getImageName();
  
          if (loginBean.getType().equals("admin")
                  || loginBean.getType().equals("ngo_coordinator")
                  || loginBean.getType().equals("ngo")) {
  
              if (ngoPojo.getNgo_id() != 0) {
                  photoUploadVO.setUsrId(ngoPojo.getNgo_id());
                  photoUploadVO.setPhotoStatus("valid");
                  photoUploadVO.setReasonForReject("pending");
                  photoUploadVO.setUser_type(ngoPojo.getType());
  
              } else {
                  photoUploadVO.setUsrId(loginBean.getUser_id());
                  photoUploadVO.setPhotoStatus("valid");
                  photoUploadVO.setReasonForReject("pending");
                  photoUploadVO.setUser_type(loginBean.getType());
              }
          } else {
              photoUploadVO.setUsrId(loginBean.getUser_id());
              photoUploadVO.setPhotoStatus("pending");
              photoUploadVO.setReasonForReject("pending");
              photoUploadVO.setUser_type(loginBean.getType());
          }
  
          photoUploadVO.setCreated_by(loginBean.getEmail());
          photoUploadVO.setCreatedDate(new Date());
          photoUploadVO.setPhoto_path(tmpFile);
          InputStream in = new ByteArrayInputStream(imageByte);
  
          // photoUploadVO.setUsrId(loginBean.getUser_id());
          // photoUploadVO.setActivityId(getAid());
          bufferedImage = ImageIO.read(in);
  
  
          if (bufferedImage.getWidth() &lt;= 400 &amp;&amp; bufferedImage.getHeight() &lt;= 400) {
  
              photoUploadVO.setDisabled("false");
              getMthd(imageByte, tmpFile);
  
          } else {
  
              try {
                  photoUploadVO.setDisabled("false");
  
                  //BufferedImage image = ImageIO.read(in);
                  ImageIO.write(resize(bufferedImage, 400, 400), "jpg", new File(tmpFile));
                  flag = photoUploadDaoService.uploadPhotos(photoUploadVO);
  
                  // profileImageService.uploadPhotos(profileImageBean);
                  if (flag == true) {
                      FacesMessage msg=null;
                      if(loginBean.getType().equals("admin")) {
                       msg = new FacesMessage("Successfully Uploaded");
                      }
                      if(!loginBean.getType().equals("admin")) {
                           msg = new FacesMessage("Successfully Uploaded(After administrator approve your photos will display on portal)");
                          }
  
                      FacesContext.getCurrentInstance().addMessage(null, msg);
                  } else {
                      FacesMessage msg = new FacesMessage("Failure", event
                              .getFile().getFileName() + " to uploaded.");
  
                      FacesContext.getCurrentInstance().addMessage(null, msg);
                  }
  
              } catch (IOException e) {
                  e.printStackTrace();
  
                  FacesMessage error = new FacesMessage(
                          FacesMessage.SEVERITY_ERROR,
                          "The files were not uploaded!", "");
                  FacesContext.getCurrentInstance().addMessage(null, error);
              }
  
          }
  
      }
  </code></pre>
  
  <p>Thanks in advance.</p>