« Previous Next »

Thread: problem with FTP using command prompt

Last post 07-15-2009 3:49 PM by robmcm. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 07-06-2009, 11:49 AM

    problem with FTP using command prompt

    Hi there

    I have a very strange issue, I am trying to FTP to a remote server ( Win2003 server) using command prompt. I can connect to the machine, it accepts my credentials, now if I do a ls command, command line just hangs and nothing happens. If I fo a "put" it it seems to hang as well. If after that I check the directory on the server where I did the "put" I can see that the file is created but it has 0 bytes.

    I have this problem ONLY whithin our office network, and the problem only occures with command prompt. If I use a third party tool like filezilla it works fine, I can also FTP using IE

     Also the command prompt method, works fine when used Outside our network.

     We checked our Antivirus, network firewall log and nothing is being stopped - we even created a rule for a particular machine so everything was opened to it and still not joy

    The Firewall on our server didn't deny anything either.

     Any advice are welcome as we have a number of application which runs scripts using DOS to ftp files to our site.

    Cheers

     Chris

  • 07-06-2009, 12:17 PM In reply to

    • kehand
    • Not Ranked
    • Joined on 09-02-2008, 10:03 PM
    • Posts 6

    Re: problem with FTP using command prompt

    Hi Chris,

    It's likely that you need passive mode enabled to connect to your FTP Server. Filezilla makes the switch automatically for the user. To do this in the ftp.exe client on Windows, try (without the double quotes):

     "quote pasv"

     That should switch you into passive mode. Please let us know if this does not resolve the situation.

     Thanks,

    Kern

  • 07-06-2009, 1:06 PM In reply to

    Re: problem with FTP using command prompt

    That sounds about right.

    Command Prompt uses Active mode by default.

    As you are able to log in (port 21), but not issue commands, it would seem you are not able to establish the Data connection which, using active mode would mean you would have to have a random port open on your firewall to connect to the server's data port of 20.

    As FileZilla uses PASSIVE mode by default, it is able to connect to the server on a random port, instead of forcing the port to be open on your firewall, to establish the data connection.

    Brock Hensley
    Technical Support Representative
    http://www.ServerIntellect.com

    Managed Servers, 24x7 U.S. Support, Web Hosting Solutions.
  • 07-07-2009, 10:10 AM In reply to

    Re: problem with FTP using command prompt

     Thank for replying,

    I tried with "quote pasv" but it didn't work. Also I can use command prompt to FTP to my server with any machine outside my network. It only fails whithin the network.

    When i say fails, in fact it connects, create the file on the remote server but doesn't transfer the data. I end up with a 0 byte file.

     thanks

     Chris

  • 07-15-2009, 3:49 PM In reply to

    • robmcm
    • Top 50 Contributor
    • Joined on 05-26-2006, 9:05 PM
    • Redmond, WA
    • Posts 125

    Re: problem with FTP using command prompt

    While "quote pasv" will actually send the PASV command over the wire, the ftp.exe command-line program is not actually capable of passive communications, so I would expect it to continue to fail.

    For command-line operations I would suggest switching to the MOVEit Freely command-line secure FTP client that I discussed in this blog, which can do both passive and FTPS communication:

    http://blogs.msdn.com/robert_mcmurray/archive/2009/01/06/ftp-clients-part-5-moveit-freely-command-line-secure-ftp-client.aspx

     

    Robert McMurray (MSFT, IIS)
Page 1 of 1 (5 items)
Microsoft Communities