4 Replies Latest reply on Apr 24, 2013 2:30 PM by gimbal2

    How to get the file path of selected file using JFileChooser

      Hi All,
      I am trying to store the file on my FTP server after selecting the file from the user workstation using JFileChooser. But I am not able to write the file on FTP server or on user local machine where application is running. I am new to this FTP server coding. Can anyone help me in this.
      This is the code I wrote on button click user will able to select the file:

      String filename1;
      File file;
      JFileChooser fc = new JFileChooser();
      file = fc.getSelectedFile();
      filename1 = file.getPath();

      Below is the code to write the file on my local machine first:

      BufferedWriter outFile = new BufferedWriter( fileName ) );
      outFile.flush( );
      outFile.close( );

      Any help will be greatly appriciated