1 Reply Latest reply on Jan 3, 2008 9:51 AM by ruben_c

    Uploading multiple files from Client to server

    kaviarasu

      Hi
      i want to upload all files from a folder in Client to Server
      Im using jsf as a front ent
      When if i test it in client side with Server in same machine and checks for the folder and upload all files it working
      But when the server is in remote palce how to upload all files from client folder to the server

      I pasted my sample coding . I browse one file from the folder and using that i find the path to the folder and upload all fles from the folder



      File f=new File(vname1);
      File f1=new File(f.getParent());
      int i=0;
      if(f1.isDirectory())
      {
      for(File a:f1.listFiles())
      {
      FileInputStream fr = new FileInputStream(a); FileOutputStream fw = new FileOutputStream(new File(location1,a.getName()));
      while((i=fr.read())!=-1)
      {
      fw.write(i);
      }
      fw.close();
      fr.close();
      }


      the above code works when the server is in same machine

      when the server is in remote place it not working

      Thanks in advance
      happy new year
      Regards
      Kaviarasu