Multiple connection FTP client

I'm in need of an FTP client that can open up multiple connections to the same file for faster downloads. CuteFTP does this, but it's taking up around 35% of my CPU while downloading for no apparent reason. I don't know the technical term for this feature I'm describing so I don't know if this is something that I can enable for any of the other great FTP clients out there (like Transmit).
Can this be done from the command line? I'd be happy with that.
Any help would be much appreciated. Thanks.
Ian

Don't take my word on this, but I'm thinking two halves equals one whole or one half of twice as much!
As for TransmitX, (my favorite), it never used more than 2.5% CPU on an eMac/1.42 sending a 7.3MB file to my online storage... could've went faster of course, and I could've got off and walked... but I wasn't expected in 'till the Train got there anyway!
There are http download/upload APPs that use multiple instances for greater speed, (forget what I last used), but many sites "outlaw them, or just don't work at all if you use them.
Sooo, what kind/size files are you transfering, and what kind of Service?

Similar Messages

  • HOw to connect FTP Client using flex

        Hi Everyone,
                   i am new to flex, i am developing one flex application, some one give example of connecting ftp client using flex. i didnot found any examples.
    thnx

    You would need to communicate with your ftp server over a socket and implement the ftp protocol on your client. The project below aims to do this, but I have never used it:
    http://maliboo.riaforge.org/
    Why not download over http (and save yourself a lot of time)?

  • Connect to FTP site with Apache commons net FTP client through Proxy

    Hello,
    I am trying to run this simple code to connect to FTP site through a proxy.
    import org.apache.commons.net.ftp.FTP;
    import org.apache.commons.net.ftp.FTPClient;
    public class MyTest {
    public static void main(String[] args) {
    String ftpHostName = "ftp.xxx.com";
    int ftpPort = 21;
    String ftpUserName = "myUserName";
    String ftpPassword = "myPassword";
    System.setProperty("socksProxyHost" ,"10.148.0.131");
    System.setProperty("socksProxyPort", "1080");
    FTPClient ftpClient = new FTPClient();
    try {
    System.out.println("connecting");
    ftpClient.connect(ftpHostName, ftpPort);
    System.out.println("connected");
    System.out.println("loging in");
    boolean successLogin = ftpClient.login(ftpUserName, ftpPassword);
    if(successLogin)
    System.out.println("success login");
    else
    System.out.println("fail login");
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    System.out.println("loging out");
    ftpClient.logout();
    System.out.println("disconecting");
    ftpClient.disconnect();
    catch (Exception e) {
    e.printStackTrace();
    I am getting the following error:
    C:\temp\ftp\test>java.exe -cp ./commons-net-ftp-2.0.jar;. MyTest connecting
    java.net.SocketException: Malformed reply from SOCKS server
    at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
    at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:265)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:437)
    at java.net.Socket.connect(Socket.java:519)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:176)
    at MyTest.main(MyTest.java:23)
    loging out
    java.lang.NullPointerException
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:471<ftp://FTP.java:471>)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534<ftp://FTP.java:534>)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:583<ftp://FTP.java:583>)
    at org.apache.commons.net.ftp.FTP.quit(FTP.java:794<ftp://FTP.java:794>)
    at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:697)
    at MyTest.main(MyTest.java:39)
    I am able to do this using a different FTP client library, ftp4j-1.5.1<ftp://ftp4j-1.5.1> using the following code:
    import it.sauronsoftware.ftp4j.FTPClient;
    import it.sauronsoftware.ftp4j.connectors.SOCKS4Connector;
    public class MyTestFtp4J {
    public static void main(String[] args) {
    String ftpHostName = "ftp.xxx.com";
    int ftpPort = 21;
    String ftpUserName = "myUserName";
    String ftpPassword = "myPassword";
    FTPClient ftpClient = new FTPClient();
    ftpClient.setConnector(new SOCKS4Connector("10.148.0.131", 1080));
    try {
    System.out.println("connecting");
    ftpClient.connect(ftpHostName, ftpPort);
    System.out.println("connected");
    System.out.println("loging in");
    ftpClient.login(ftpUserName, ftpPassword);
    System.out.println("success login");
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    System.out.println("disconecting");
    ftpClient.disconnect(true);
    catch (Exception e) {
    e.printStackTrace();
    So I know the proxy settings are correct.
    The java version I used to compile and run my apps is 1.6.0_06 Does anyone can help figure out what is wrong when I use the Apache commons net FTP client?
    Thank you
    Jon

    Is the old AirPort Extreme base station (AEBS)
    configured so that the option to distribute IP
    addresses is DISABLED? If so, configure the new AEBS
    to act as a bridge.
    Are you suggesting I use a set-up with TWO AEBSs? Set up a bridge (not sure how) and then use the old AEBS to connect to the DSL modem and broadcast to the new Extreme which will then be the router to the other computers on the network?
    Do you have any port mapping or default host enabled
    on the old AEBS?
    I do not understand, not do I see these options in the Base Station utitlity; perhaps they are in the FTP options--but that, I'm sorry to say, is not obvious to my inspection.
    Duane, can you give me a few more basic instructions? Thanks
    iMac 17    

  • FTP client Default Data Connection Ports

    I'm developing a simple FTP client from the socket level. The only documents I am referring are J2SDK API and RFC 959. For the control connection I am ok, but for the data connection is not. According to the RFC 959 : "The user-process default data port is the same as the control connection port". The control connection port is used by my FTP command connection while connected to the FTP server, so how can I "listen" to the same port before I send the "RETR" command to the server ?
    Pls give me a hint , Thanks
    Samuel

    The way I read it is that the client opens the control connection by connecting to the server control port (usually 21) from a random port. The client also listens on its own port 21. The server will eventually establish a connection from a random port to the client port 21. I may be wrong though. The best way, IMHO, to proceed, is to use a network monitor such as TCPDUMP or WINDUMP and see what other FTP clients/servers do. I also know for a fact that there are open source FTP clients and servers, even in Java.

  • Does the Built-in Windows FTP Client Support a Secure Connection?

    I have set up Server 2008 IIS w/ FTP. I set the SSL setting to require a secure connection. However, I can't connect to the FTP server from the built-in Windows FTP client. I CAN get it to work in FileZilla after modifying my connection properties.
    Does the built-in Windows FTP client support secure connections? I received a request to set this up so our internal employees can share files with external customers. Many times our customers are unable to install any kind of third party software on their
    computers.
    Thanks in advance for the help.

    Hi,
    Based on my known, the built-in FTP client does not support secure connections.
    Similar thread:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/9500d7c2-cf18-4ab1-a0cb-1e277deab33c/is-it-possible-to-connect-to-iis-75-sslrequired-ftp-site-via-windows-explorer-or-ie-?forum=winserverNIS
    If it does not help, you could ask in IIS forums as Meinolf Weber mentioned.
    Hope this helps.
    Regards.
    Vivian Wang

  • Can't connect to FTP through FINDER   (other ftp clients work)

    I try to connect to my schools ftp icarus.engr.uconn.edu through finder's, Go -> Connect to Server
    but every time I try it tells me you have entered an invalid password or username. The thing is that I can connect to the ftp through any FTP client like filezilla or Cyberduck even the Terminal ftp program will connect, but not Finder. Finder tells me the password or username is invalid. ??

    Is it not prompting you? You can imbed your username or even your username + password in the URL.
    e.g.
    ftp://username@server
    or
    ftp://username:password@server
    There should be no issue connecting. BUT... the imbedded FTP in Finder only allows for downloads. You can't upload.
    You can upload via the command line FTP client, and of course a slew of 3rd party FTP clients (some of which you've already mentioned.)
    Message was edited by: Tim Campbell1
    Message was edited by: Tim Campbell1

  • FTP-client behind RRAS - unable to connect to external FTP servers

    FTP-client behind RRAS - unable to connect to external FTP servers
    A small network (10-20PCs) without any segmentation - one LAN with one Gateway.
    1. If the Gateway is some small hardware device, there are not any problems to make FTP-connections from LAN to Internet FTP-servers
    2. If the Gateway is Win2003+RRAS+NAT or Win2003+ISA2005, there are not any problems to make FTP-connections from LAN to Internet FTP-servers
    3. But if the gateway is Win2008+RAS+NAT or Win2012+RRAS+NAT, the computers in the LAN are not able to connect to Internet FTP-servers
    I made a few tests:
    1. On Win2012+RRAS+NAT
    TurnOff Windows Firewall for All profiles (Domain, Private, Public) - the problem disappears, it it possible to connect to external Internet FTP-servers.
    2. On Win2012+RRAS+NAT
    TurnOff Windows Firewall only for Domain profile - the problem disappears, it it possible to connect to Internet FTP-servers.
    3. On Win2012+RRAS+NAT
    TurnOn Windows Firewall for All profiles (Domain, Private, Public)
    But I excluded the Internal NIC in this list
    Windows Firewall / Properties / Domain Profile / Protected network connections 
    and the problem disappears again
    My question is:
    What new Firewall rule  I have to make and where to place it (to be able to make FTP-connection from LAN to Internet FTP-servers)?
    I made some attempts to allow port21, but any success.

    Thank you, but did you try this ? 
    Can you describe in detail "exclusion rule for FTP traffic" ?!
    In my previous post, I want to say that if you use Win 2008/2012 RAS+NAT as a network gateway, than it is not possible to make FTP-connections to external FTP servers from the computers behind that gateway.
    And the standard attempts to make "Allow"-rules for port 21 in the gateway firewall (Win 2008/2012), do not solve the problem.
    No matter which FTP-client you can try to use.
    To see this problem, just make few simple tests: 
    ">telnet <ftp-server> 21" 
    with firewall on/off  and inbound/outbound "Allow port 21 rule (All/Domain/Private/Public)"
    In my country, the Government Tax Department uses FTP-protocol to collect monthly data from companies. 
    And it is too stupid scenario (to be a small company and to) upgrade from Win 2003 to a newer 2008/2012 and than to not be able to make all your jobs.
    -------EDIT---------
    The same problem (and its solution) is described here:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/0c68aed6-e22b-4cd4-86bd-f3c767e88349/advanced-firewall-blocking-through-ftp-traffic-rras
    The magic command:
    ">netsh routing ip nat delete ftp"
    solved the problem for me.
    And here is the description of this command - "Disables the FTP proxy on the NAT server."
    http://technet.microsoft.com/en-us/library/cc754535(v=ws.10).aspx#BKMK_106

  • IWeb integrated ftp won't connect. Settings confirmed via standard ftp client

    I am nable to ftp via the iWeb integrated ftp interface. I have tested the settings via a standard ftp client without issue.
    Any ideas?
    Thanks! Joe

    iWeb is kind of unusual in that it publishes a folder containing the website files and an external index.html that opens the home page. There's also a copy of this index.html file inside the folder.
    This arrangement is to suit publishing to the Apple server - MobileMe - and is kind of illogical when publishing else where.
    Uploading using the iWeb built in FTP means that the URL has the folder name in the path...
    http://www.domain-name.com/Site-Name/Page-Name.html
    To avoid this, the site needs to be published to a local folder using the second method on the page I referred to above and the files inside the folder uploaded to the root on the server....
    http://www.iwebformusicians.com/iWeb/URLs-Favicons.html

  • Issue with Ftp Client / Server using Sockets

    I have developed a Ftp Client and a Ftp Server. The client Connects to the Ftp Server and sends files to the ftp server. It is a multi threaded server and can have multiple clients connecting to it.
    If a client goes down...the server waits till the client comes up
    Similarly the client waits if a server goes down and reconnects when the server is again up and running
    i am having a strange issue here. When two clients go down and reconnect to the server...They take a long time to connect and transferring of files takes a long time...
    Other wise in all other scenarios the duo work properly.
    Any feedback and suggestion about this strange issue from all you java gurus out there will be deeply appreciated.
    Here is the client code
    import java.net.*;
    import java.net.Socket;
    import java.net.InetAddress;
    import java.io.*;
    import java.io.File;
    import java.util.*;
    import java.lang.*;
    import java.lang.Object;
    import javax.crypto.*;
    import java.util.regex.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.File.*;
    import java.nio.channels.FileLock;
    public class  FTPClient {
         public static void main(String[] args) throws Exception
              Timer timer = new Timer("Test Timer");
              timer.scheduleAtFixedRate(new TimerTask()
                   private int counter = 0;
                                            public void run() {
                                                                     try     {                                                                                
                                                                              System.out.println(counter++);
                                                                               Socket soc=new Socket("xxx.x.x.xx",5217);
                                                                               System.out.println("Socket Initialised.");          
                                                                               transferfileClient t=new transferfileClient(soc);
                                                                               t.SendFile();
                                                                               System.out.println("run complete.");                                                                           
                                                                          catch(Exception ex)
                                                           }, 10000, 40000);
         static class transferfileClient
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;
         BufferedReader br;
         transferfileClient(Socket soc)
              try
                   ClientSoc=soc;
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   br=new BufferedReader(new InputStreamReader(System.in));
              catch(Exception ex)
         //encrypto routine starts
    class DesEncrypter {
           Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03
            // Iteration count
            int iterationCount = 19;   
            DesEncrypter(String passPhrase) {
                try {
                             // Create the key
                             KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                             SecretKey key = SecretKeyFactory.getInstance(
                             "PBEWithMD5AndDES").generateSecret(keySpec);
                             ecipher = Cipher.getInstance(key.getAlgorithm());
                             dcipher = Cipher.getInstance(key.getAlgorithm());   
                             // Prepare the parameter to the ciphers
                             AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                             // Create the ciphers
                             ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                             dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends     
         void SendFile() throws Exception
                   try
                   String directoryName; 
                   // File object referring to the directory.
                   String[] files;        // Array of file names in the directory.        
                   //directory = new File ( "C:\\FTP\\" ) ; 
                   File directory1 = new File("C:\\FTP");
                        boolean successmk = directory1.mkdir();
                        if (!successmk) {
                             // Directory creation failed /Already Exists
                        File directory = new File("C:\\FTP\\ftpc");
                        boolean successmk1 = directory.mkdir();
                        if (!successmk1) {
                             // Directory creation failed /Already Exists
                   //directory = new File ( "E:\\FTP-encrypted" ) ;           
                if (directory.isDirectory() == false) {
                    if (directory.exists() == false)
                       System.out.println("There is no such directory!");
                    else
                      System.out.println("That file is not a directory.");
                else {
                    files = directory.list();
                    System.out.println("Files in directory \"" + directory + "\":");
                    for (int i = 0; i < files.length; i++)
                             String patternStr = "xml";
                             Pattern pattern = Pattern.compile(patternStr);
                             Matcher matcher = pattern.matcher(files);
                             boolean matchFound = matcher.find();
                                       if (matchFound) {                                   
                                       System.out.println(" " + files[i]);                                        
                                       String filename;
                                       filename=files[i];                                   
                                       File f=new File(directory,filename);
                                       FileLock lock = null;                                   
                                       FileOutputStream fos = new FileOutputStream(f, true);
                                       lock = fos.getChannel().tryLock();
                                                 if (lock == null) {
                                                 System.out.println(" Failed to get the file lock: means that the file is locked by other instance.");
                                                 fos.close();
                                                 else
                                                                     InetAddress addr = InetAddress.getLocalHost();                                                                      
                                                                               // Get IP Address
                                                                               //byte[] ipAddr = addr.getAddress();
                                                                               String ip= addr.toString();                                                                      
                                                                               // Get hostname
                                                                               //String hostname = addr.getHostName();
                                       System.out.println(" Lock Acquired.");
                                       lock.release();
                                       fos.close();
                                       dout.writeUTF("SEND");
                                            dout.writeUTF(ip);
                                       dout.writeUTF(filename);
              //String msgFromServer=din.readUTF();          
    DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
    // Encrypt
              FileInputStream fino=new FileInputStream(f);
              encrypter.encrypt(fino,
    new FileOutputStream("ciphertext.txt"));               
              fino.close();
              FileInputStream fin=new FileInputStream("ciphertext.txt");          
              int ch;
              do
                   ch=fin.read();
                   dout.writeUTF(String.valueOf(ch));
              while(ch!=-1);
              fin.close();          
              String option;
                        option=din.readUTF();
                             if((option.compareTo("Delete")==0))     
                                  boolean success = (new File("ciphertext.txt")).delete();
                                  boolean success1 = f.delete();
                                  if (success) {
                                  System.out.println("File Sent ...");
                                  if (success1) {
                                  System.out.println("--File deleted from Client ...");
         for (int j = 0; j < 999999999; j++){}
                                       }//pattermatch loop ends here
    else
                             { //System.out.println("   " + "Not an XML file-------->" +files[i]);
    for (int jb = 0; jb < 111999999; jb++){}
              }// for loop ends here for files in directory
                   }//else loop ends for directory files listing               
         System.out.println("sendfile finished...");
         return;
         }               catch(Exception ex)          {ex.printStackTrace();}                    
         }//sendfile ends here     
         public void displayMenu() throws Exception
                   System.out.println(" Send File");                    
                        SendFile();
                        return;          
    And here is the server code...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.text.Format;
    import java.lang.Object;
    import java.lang.*;
    import javax.crypto.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    public class FTPServer
    {     public static void main(String args[]) throws Exception
         {     ServerSocket soc=new ServerSocket(5217);
              System.out.println("FTP Server Started on Port Number 5217");
              while(true)
                   System.out.println("Waiting for Connection ...");
                   transferfile t=new transferfile(soc.accept());               
    class transferfile extends Thread
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;     
         transferfile(Socket soc)
         {     try
              {     ClientSoc=soc;                              
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   System.out.println("FTP Client Connected ...");
                   System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
                   //System.out.println("FTP Client Connected ..." + ClientSoc.getRemoteSocketAddress());
                   start();               
              catch(Exception ex)
    //encrypto routine starts
    class DesEncrypter {
            Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03 };   
            // Iteration count
            int iterationCount = 19;   
           DesEncrypter(String passPhrase) {
                try {
                    // Create the key
                    KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                    SecretKey key = SecretKeyFactory.getInstance(
                        "PBEWithMD5AndDES").generateSecret(keySpec);
                    ecipher = Cipher.getInstance(key.getAlgorithm());
                    dcipher = Cipher.getInstance(key.getAlgorithm());   
                    // Prepare the parameter to the ciphers
                    AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                    // Create the ciphers
                    ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                    dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                        //added later on
                        in.close();                    
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends
    //not implemented right now as we arent using the ftp server to download stuff...can be activated later on if we want
         void SendFile() throws Exception
              String filename=din.readUTF();
              File f=new File(filename);
              if(!f.exists())
                   dout.writeUTF("File Not Found");
                   return;
              else
              {     dout.writeUTF("READY");
                   FileInputStream fin=new FileInputStream(f);
                   int ch;
                   do
                        ch=fin.read();
                        dout.writeUTF(String.valueOf(ch));
                   while(ch!=-1);     
                   fin.close();     
                   dout.writeUTF("File Received Successfully");                                   
         String Compare(String filename) throws Exception
                        ///dout.writeUTF("entering compare");
                        String dateTempString=new String();
                        Date dateValue=new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                        dateTempString = formatter.format(dateValue);
                        File dir1 = new File("C:\\FTPnew");
                        boolean success2 = dir1.mkdir();
                        if (!success2) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success = dir.mkdir();
                        if (!success) {
                             // Directory creation failed /Already Exists
                        File ftemp=new File(dir,dateTempString + filename);
                        File fnewtemp=new File(dir,"new-enc-"+filename);
                        // Create encrypter/decrypter class
                        DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                        FileOutputStream fout=new FileOutputStream(fnewtemp);     
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();
                        //dout.writeUTF("written temp en file");
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(fnewtemp),
                    new FileOutputStream(ftemp));
                        //String Option;
                        dout.writeUTF("Delete");                    
                        System.out.println("File Upload Successfull--Duplicate file with timestamp Created");          
                        boolean success1 = fnewtemp.delete();                    
                        return "hello" ;
         void ReceiveFile() throws Exception
              String ip=din.readUTF();
              System.out.println("\tRequest Coming from Internal IP Address : "+ ip);
              String filename=din.readUTF();
              if(filename.compareTo("File not found")==0)
                   return;
              // Destination directory
       File dir11 = new File("C:\\FTPnew");
                        boolean success22 = dir11.mkdir();
                        if (!success22) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success21 = dir.mkdir();
                        if (!success21) {
                             // Directory creation failed /Already Exists
              File f=new File(dir ,"enc-"+filename);
              File fe=new File(dir,filename);
              String option;
              if(fe.exists())
                   //dout.writeUTF("File Already Exists");
                   String compvalue = Compare(filename);
                   //dout.writeUTF(compvalue);
                   if(compvalue.compareTo("hello")==0)
                        //dout.writeUTF("Transfer Completed");
                        return;
                   option=din.readUTF();
              else
                   //dout.writeUTF("SendFile");
                    option="Y";
                   if(option.compareTo("Y")==0)
                        // Generate a temporary key.       
            // Create encrypter/decrypter class
             DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                 FileOutputStream fout=new FileOutputStream(f);                    
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();                    
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(f),
                    new FileOutputStream(fe));          
                        boolean success2 = f.delete();
                        dout.writeUTF("Delete");
                        System.out.println("File Upload Successfull");                    
                   else
                        return;
         public void run()
              while(true)
                   try
                   String Command=din.readUTF();
                   if(Command.compareTo("SEND")==0)
                        System.out.println("\tSEND Command Received ...");     
                        ReceiveFile();
                        continue;
                   catch(Exception ex)
                        //System.out.println("\tClient Terminated Abnormally ...........");
                        continue;

    Please note that this is not an FTP client and server. FTP is defined by a standard IETF protocol and this isn't it.
    Then, move the following lines:
    din=new DataInputStream(ClientSoc.getInputStream());
    dout=new DataOutputStream(ClientSoc.getOutputStream());
    System.out.println("FTP Client Connected ...");
    System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
    //System.out.println("FTP Client Connected ..."+ClientSoc.getRemoteSocketAddress());from the constructor into the run() method. i.e. don't do anything with the socket in the thread which handles the accept().

  • URGENT:Handle multiple connection in a multithreaded server.

    I hava a multithreaded server where it can handle multiple connection.
    The program works in this way. First, it will wait for connection. Once it accepts a connection, it will pass the socket to a thread class which will in turn process the connection. Then, the server will go back to the infinite loop to wait for new connection.
    Since I am not very familiar on using thread, I would like to post the following questions:
    1) Let say that my server can handle multiple connections. This is to cater for the different requests from the client. For instance, the client may make one connection for chatting and another connection for sending file(something like we have in Yahoo Messanger). So, at the server side, how can I differentiate between the connection for CHAT and the connection for SEND FILE so that I can handle the requests separately. It means I can save the file sent from client and display the chat message in the JTextArea?
    2) How can I stop the server, clean up the thread and start the server again for waiting new connection? Currently, I can just start my server once.
    For reference,following are parts of my program:
    public void listenSocket(){
    try{
    server = new ServerSocket(5000);
    } catch(IOException e) {
    System.out.println("Failed to listen on port 5000");
    System.exit(0);
    try{
    while(true){
    server1frame sframe=null;
    ChatHandler handler;
    handler = new ChatHandler(sframe,server.accept(),jTextArea1,jTextField1,jFileChooser1);
    handler.start();
    } catch(IOException e) {
    System.out.println("Accept failed:5000");
    System.exit(0);
    //to close the connection as the final steps before program exit.
    } finally {
    try{
    server.close();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    public void run() {
    out.println("Connection Established");
    out.flush();
    try {
    String line;
         while(!(line =in.readLine()).equalsIgnoreCase("QUIT")) {
    if(line.startsWith("CLIENT"))
    jTextArea1.append("\n"+line);
    else if(line.startsWith("Connecting")) {
    jTextArea1.append("\n"+line);
    else if (line.startsWith("Finish")) {
    JOptionPane.showMessageDialog(sframe,"File has finished downloading",
    "File Download Complete",JOptionPane.INFORMATION_MESSAGE);
    else {
    BufferedWriter fout = new BufferedWriter(
    new FileWriter("e:/num1.txt",true));
    fout.write(line);
    fout.newLine();
    fout.flush(); }
         } catch(IOException ioe) {
         ioe.printStackTrace();
         } finally {
         try {
              in.close();
              socket.close();
         } catch(IOException ioe){
    System.out.println("Fail to close connection.");

    1) Let say that my server can handle multiple
    connections. This is to cater for the different
    requests from the client. For instance, the client may
    make one connection for chatting and another
    connection for sending file(something like we have in
    Yahoo Messanger). So, at the server side, how can I
    differentiate between the connection for CHAT and the
    connection for SEND FILE so that I can handle the
    requests separately. It means I can save the file sent
    from client and display the chat message in the
    JTextArea?Either your server listens on two different ports for two different protocolls, (then you would a server thread for each port) or you accept connections for both protocolls on both ports, and have the client state what protocoll it is using :
    eg:
    accept Connection - start new Thread - read first line - depending on protocoll pass protocoll object (CHAT, FTP) to run method
    There is an example for a simple protocoll at : http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
    2) How can I stop the server, clean up the thread and
    start the server again for waiting new connection?
    Currently, I can just start my server once.You normally start servers only once. It should then be up and listening for it's entire lifetime. Restarting a server should only be needed if it hangs or crashes.

  • FTP client is not working in active mode

    Hi,
    I have a ftp issue trying to download iweb files.
    My provider enabled me a ftp access.
    I tried to connect to it with transmit or rbrowser ftp client (passive mode disabled). The connection works well but i can not retrieve the list of files.
    However using my PC and filezilla ftp client in active mode, the connection did work properly.
    Any idea to help make this connection work on my mac ?
    Thanks

    Perhaps this will help...
    http://slacksite.com/other/ftp.html
    "The main problem with active mode FTP actually falls on the client side. The FTP client doesn't make the actual connection to the data port of the server--it simply tells the server what port it is listening on and the server connects back to the specified port on the client. From the client side firewall this appears to be an outside system initiating a connection to an internal client--something that is usually blocked."

  • How can FTP users access my NAS system via FTP client?

    I recently purchased a 2 bay, 4TB Buffalo Link Station DUO in order to solve some FTP issues.  I have about 50 users outside my LAN that need to connect drop files on my NAS, however nobody seems able to connect via FTP client.  If they login using the Web Access Dynamic DNS address they can read and write via their web browser, but it's clunky and slow.
    My NAS system has been given the IP adress of 192.168.1.254 which seem to me that it's a local IP adress, not a public/static IP. Do I need to manually assign an IP adress to my NAS system in order fot users to log into that specific IP and go directly to the shared folders on the NAS system?
    Thanks in advance!

    Your NAS is getting that IP because it is behind your Router, which is the normal way to use it and as it should be.
    You can not ASSIGN a public IP you your NAS. Only your ISP can do that and usually that incures an extra cost for more than 1 Public IP address. Usually included with a Business account and most of the time only available with a Business account. ISP do not want home owners running FTP or Mail servers on a residential acounts.
    As noted you have to forward the noraml FTP port, port 21, in your Router to the IP of the NAS. Since you already have that port forwarded to your Mac, which I have no idea why you did that, you have to either change that port forwarding to the NAS IP or make the FTP server on the NAS respond to some other port and forward that on the router to the IP of the NAS. The to access the NAS FTP server you have to enter the piblic IP address of your router followed with a :and port #. XXX.XXX.XXX.XXX:22 or whatever port # you assign to the FTP server on the NAS.

  • Looking for a specific feature in an FTP Client

    Hello!
    I am looking for a "simple" feature in any FTP client for OS X.
    I have tried Fetch, Transmit, CyberDuck and Interarchy 7.x and none had the ability to throttle uploads/downloads. I work with a limited bandwidth and sometimes have to download files (or upload) in the background but at a very slow speed (because the peer has a poor connection).
    None of these nice (and they are nice!) ftp programs can do this. I have to either use wget via the command line (wget --limit-rate=xx) or use Total Commander for Windows inside a Parallels Virtual Machine.
    Does anybody know about a Mac FTP client that can throttle and enqueue items easily?
    Thanks in advance!

    Look at "lftp". It as about a zillion parameters that can be set. One of them is "net:limit-total-rate"
    Quoted from the Docs....
    limit transfer rate of all connections in sum. 0 means unlimited. You can specify two numbers separated by colon to limit download and upload rate separately. Note that sockets have receive buffers on them, this can lead to network link load higher than this rate limit just after transfer beginning. You can try to set net:socket-buffer to relatively small value to avoid this.
    Find lftp here lftp.yar.ru It is also in thr Fink archive. http://fink.sourceforge.net/

  • Connect mac client to mac printer share across subnets

    I need to share printers from a Mac.  I need to connect
    Mac clients on different subnets to the Mac shared printers.  I installed
    a Mac mini, connected to printers via HP JetDirect Socket (port 9100), and
    shared them.  I was able to print from the Mac mini, and connect Mac
    clients on the same subnet to the shared printers with Bonjour and print.
    I moved the Mac mini to its intended location on another subnet.  I
    immediately learned that Bonjour does not publish services across
    subnets.  I could not find documentation on how to connect to a Mac shared
    printer across subnets, but I did find some third party documentation (only some incomplete
    documentation from Apple) on how to implement DNS-SD Service Discovery.  I
    enabled DNS-SD and was able to publish the printer shares across subnets, but I
    was still unable to connect to the printer shares from a Mac client.  I
    found some third party documentation (none from Apple) on how to manually connect to a Mac
    printer share by specifying the IP address of the server, specifying the CUPS
    default IPP protocol, and the print queue name.  I was unable to connect
    to the shared printers.  I receive ping replies from my Mac mini, and port
    scan reveals that port 631 for IPP, CUPS default, is open.  Printer
    sharing is configured so everyone can print. I am able to connect to the Mac
    mini with VNC Screen Sharing.  I don’t see how this can be a network
    issue.
    Macs don’t seem to like to connect to our Windows
    shared printers because of our PaperCut software, and connecting Mac clients to
    Windows printer shares and authentication is beyond the average user,
    exacerbated by Macs not behaving the same as Windows when bound to an Active
    Directory domain.
    I called Apple support, they escalated to Apple Enterprise
    support.  Apple Enterprise support said they couldn’t help me beyond a
    single network with no subnets, but Apple Engineering might be able to solve
    the problem for $695.
    Why do I need to pay $695 to learn how to connect Mac
    clients to Mac shared printers, something that should be easy and intuitive and
    have documentation readily available?  Windows printer sharing is easy and
    intuitive and documentation is readily available, and services are published
    across subnets without have to implement DNS-SD.

    Thank you for your reply.  I followed the instructions in the sybaspot.com site and in some of the included references to set up DNS-SD.  DNS-SD worked, but I couldn't connect the Mac client to the Mac shared printers.
    I also found http://www.papercut.com/products/ng/manual/ch-mac-printing-10-8-9.html#ch-mac-pr inting-10-8-9-sharing-printers.
    I expanded my search and found this: http://support.apple.com/kb/PH13940, last modified May 8, 2014.  I started work on my project February 2014.  Apple Support could have told me about this document.
    PH13940 says: "The computers must be on the same local network as your Mac".  Apple must not consider multiple subnets one network.
    PH13940 says: "Printer sharing is for printers attached directly to your Mac. You don’t need to share network printers, because they are already shared on the network."
    Apple must define "network printers" as any printer with a network interface.  Microsoft defines network printers as printers shared by another computer.  TCP/IP ports are local ports on a Windows computer, so TCP/IP connected printers are local printers that can be shared.  Multiple users on a Mac all see the same connected printers.  Multiple users on Windows all see the same local printers, but network printer connections can be different for each user.
    Apple must not see any value in accounting for printing and assigning the cost to the user or department.  We need to account for printing and cannot have any users bypassing the system by printing directly to printers.  I have created Access Control lists on the printers to limit connections to the specific IP addresses of our print servers.
    The documents about setting up DNS-SD and IPP connections must have assumed USB connected printers on a Mac.  The odd thing is that I was able to share a network printer from the Mac mini when the client Mac was on the same subnet.  Is PH13940 wrong?
    I am Microsoft Certified Systems Engineer 1999 and Apple Certified Technical Coordinator 2013.

  • FTP Clients on E72: can't get any to work

    Hello again.
    So, I've been trying to get FTP Client functionality on my Nokia E72. I guess I'm just doing something wrong, but I cannot figure it out.
    I tried:
    * SIC! FTP (native Symbian App)
    * PaderSyncFTP (Java)
    * MobyExplorer (Java)
    None of the applications work on my E72. They do work however (with the same SIM card) on my Nokia 6120 classic.
    The applications seemingly try to connect on the E72, however it never actually initiates a packet data connection at all. As if there wouldn't be an application trying to access the Internet.. I also tried to set up WLAN as my primary access point. Works for everything else, but not for those FTP clients.
    I tried several FTP servers on different ports (21, 666, 667). All work on 6120 classic, none work on E72. Also tried to switch from passive to active mode to no avail.
    Funny thing is: When I use my PuTTY SSH Client on E72 to just probe an FTP servers port, that works! I can see the connection attempt in my FTP Servers logfile, and I can see the Server responding in PuTTY!! But with the actual FTP clients i never even get out into the network, wether I try to use WLAN or 3.5G..
    I'm lost. Everything else works. SSH2 using PuTTY works, Skype works, webbrowsing works.
    What could be prohibiting all those FTP clients from initiating a connection?! For MobyExplorer I even tried all of its four "connection modes" that they have for "buggy firmwares". Doesn't make a difference at all.
    Also: Those apps never ask for an Access Point on the E72, even if the AP is configured to do so.
    I have no idea what to do...  Any advice would be appreciated! Maybe it's just some strange configuration issue..
    Thanks.

    k-lite is a free codec that makes windows media player 11 work and it has its own player.
    T430u, x301, x200T, x61T, x61, x32, x41T, x40, U160, ThinkPad Tablet 1838-22R, Z500 touch, Yoga Tab 2 Windows 8.1, Yoga Tablet 3 Pro
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    If someone helped you today, pay it forward. Help Someone Else!
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

Maybe you are looking for

  • Is There Something Wrong with My Power Supply?

    So, I work in video editing, and I recently replaced an old iMac with a co-workers old Mac Pro. However, instead of making everything faster, Final Cut can barely run, with glitches popping up left and right. However, the computer seems to run fine t

  • Screen Freeze With Light Blue Tint

    Hi, I bought a refurbished 15" MacBook Pro from the Apple Store last August (2011 model, I think, running Mountain Lion OS X 10.8.3) and it's been fine up until the past week. Twice now, when the computer has been asleep and I've woken it up, the scr

  • Why does time machine backup disk images?

    I have Time Machine backing up my folders on my Time Capsule but when I look at the Time Capsule drive in the Finder it shows one Sparse Disk Image Bundle. If I lose a folder on my iMac, how can I easily get the folder off of the Time Capsule? Is the

  • Need a way to request for a web resource (e.g .css, .gif file) using jpdk

    I am wondering if there is any way by which we can request for a web resource from portal to portlet provider. Currently if in order to display image I need to make direct request to portlet provider rather than routing the request through portal. As

  • Transferring information from very old to latest Macs.

    We still have several old Mac Quadras/Centrus. My wife has been using one of them for our family finances, bridge schedules, etc. since back in 1991-2. We just now bought her an iMac to do these functions. How can we connect between our newer Macs (A