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:
To run the process....
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
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
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