0 Replies Latest reply on Nov 13, 2009 3:04 AM by mlindhout79

    FileRef.upload connects but no upload...?

    mlindhout79

      Hi All,

       

      I'm quite a flex newby... trying yo upload a file with Flex (using fileReference.upload). I create a Filter, using commons-fileupload to parse the request and store the files. Deployed it in Tomcat. Here's my doFilter methode:

       

              if (ServletFileUpload.isMultipartContent(req)) {
                  try {
                      System.out.println("1");
                      ServletFileUpload upload = new ServletFileUpload(itemFactory);
                      System.out.println("2");
                      List<FileItem> list = upload.parseRequest(req);
                      System.out.println("3");
                      for (FileItem fi : list) {
                          System.out.println(fi);
                      }
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
                  System.out.println("Done!");
              }
              else {
                  System.out.println("Nope");
              }

       

      Is see '1' and '2' in the console, but then in the flashplayer I get a #2038 IO error....

       

      I searched the forums, and there are much samples doing the same as me... but I didn't get it to work. What am I doing wrong?

       

      Here's the actionscript part:

       

                     var uploadURL:URLRequest = new URLRequest();
                      uploadURL.url = "http://192.168.1.171:8080/blazeds.war/services/upload";
                      fileRef.addEventListener(IOErrorEvent.IO_ERROR, uploadHandler);
                      fileRef.addEventListener(HTTPStatusEvent.HTTP_STATUS, uploadHandler);
                      fileRef.addEventListener(ProgressEvent.PROGRESS, progressHandler);
                      fileRef.upload(uploadURL);

       

      Thanx