Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp problem

Status
Not open for further replies.

gmmastros

Programmer
Feb 15, 2005
14,909
US
I am trying to automate an ftp process and I am having a problem.

I want to download 3 files from another companies ftp server. They have given me a username and password that I use to access their ftp server. Since I want to automate this process, many (if not all) of the 3rd party ftp applications will not work for me (or perhaps I just don't know how).

If I use IE 8 or FireFox to connect the ftp server, I can click on the file and it will download without any problems, every time. If I use the FTP DOS command, I can connect every time, but when I try to download the file it will occasionally work, but will mostly fail. It's an intermittent problem, and I just can't seem to solve it.

At a command prompt, if I type FTP, sometimes I get a message like this:

[tt]
Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\Users\gmmastros>ftp
ftp: connect
C:\Users\gmmastros>
[/tt]

Other times, it opens an FTP prompt. More importantly, though, sometimes the get command will work, and sometimes it won't.

[tt][blue]
C:\Users\gmmastros>ftp
ftp: connect
C:\Users\gmmastros>ftp
ftp> open ftp.XXXXXXXXX.us
Connected to ftp.XXXXXXXXXXX.us.
220 Microsoft FTP Service
User (ftp.XXXXXXXXX.us:(none)): YYYYYYYYYY
331 Password required for YYYYYYYYY.
Password:
230 User YYYYYYYYYYY logged in.
ftp> get charges.zip
200 PORT command successful.
150 Opening ASCII mode data connection for charges.zip(9463053 bytes).
[green]226 Transfer complete.
ftp: 9463053 bytes received in 57.52Seconds 164.51Kbytes/sec.[/green]
ftp> get offender.zip
200 PORT command successful.
150 Opening ASCII mode data connection for offender.zip(40345355 bytes).
[!]Connection closed by remote host.[/!]
ftp>
[/blue][/tt]

As you can see... one file downloaded, but the other file did not.

I am running this on Vista Business 64-bit. Running the same command on a Windows 2003 server 32-bit works perfectly every time.

On the vista computer, the FTP.exe properties show....
File version=6.0.6000.16386
size=46.5 KB
Date Modified=1-20-2008 10:46 PM

On the windows server computer....
Product Version=5.2.3790.3959
File version=5.2.3790.3959 (srv03_sp2_rtm.070216-1710)
Date Modified=2/17/2007 10:03:40 AM

Both computers are connected to the network in the same way. We have a box from our ISP connected to a router, then connected to a hub, and finally connected to each computer. Whatever the problem is, I don't think it's related to the internet connection (but could be wrong).

To automate the process, I have created a text file, like this:

Code:
open ftp.xxxxxx.us
user yyyyyyy zzzzzzz
get charges.zip W:\apps\xxxxxxxxxx\charges.zip
bye

To run the process....

Code:
ftp S:MyFTPCommands.txt


I have a couple questions:

1. Is there anything I can do to make the ftp process more reliable?

2. Is there an alternative method I could/should use to download the ftp file?



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Have you tried GlobalScape CuteFTP Pro? I once found, at least 4 years ago, that they had ways you could run custom scripts, similar to how you can use VBA in MS Office apps. I was just about to seriously tinker with it to further automate my duties, when I moved to a different position. [smile]

--

"If to err is human, then I must be some kind of human!" -Me
 
That is a really well-presented problem description!

Unfortunately my knowledge of Vista in general and 64-bit version in particular is very limite. However, I have found the MS command line FTP client to be very flaky, especially when transferring large files.

It may help to close and re-open a new session for each file.

But I would really recommend switching to a different FTP client. MoveItFreely is a drop-in replacement for the MS FTP client which is available in a Vista compatible version. I use it extensively under XP and it is much better.

Check it out here:
It is free, and supports the same scripting commands as the MS FTP client, though it has more coptions available such as passive mode switching and FTP over SSL.

Jock
 
Downloading the 30-day trial now. Thanks.

Still wondering why the ftp command that ships with vista is so flaky.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
I've never used the command line ftp, but it sounds like you're lagged and that it's timing out. Is there a way to increase the timeout option on the commandline?

~AZ

 
I have been having the same problem on XP.
Up until several months ago ftp commands worked fine.
However, recently I started getting intermittent "ftp connect" errors.

I haven't figured out the cause, however, I have found a few things that you might try:
If I exit one or more of the following applications, then ftp commands work reliably:
1) browsers - firefox, explorer, chrome, etc.
2) outlook
3) Yahoo IM

Sometimes I have to exit all three, sometimes exiting browsers is enough. As long as these applications are closed, I can run ftp commands over and over without problem.

So far my best guess is that either a msoft update or an application installation caused this problem. However, I have not yet discovered the source. I have not tried other command line ftp clients. FTP transfers within firefox do not appear to be affected.
 
I hate to say it, but I kinda gave up on this issue. Ultimately, I needed to download data from an FTP server on a daily basis and then load the data in to a SQL Database. I absolutely could not get reliable FTP downloads on my desktop computer. But... I did not really want it there, either. FTP does run reliably from one of my servers, so problem solved.

Thanks to everyone that helped.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top