Now I've got a new problem I ran into, here's the verbose code:
you'll see 6 lines up from the bottom a "Transfer Timeout..."
Unfortunately some of the files I'm moving can be 0 bytes at times. Is there a way to compare the file size on the server with the received file size?
Thanks!
you'll see 6 lines up from the bottom a "Transfer Timeout..."
GETFILE("b_Execs_20081208_COMPANY.csv")This situation created a file with 0 bytes of data. The checks I implemented in http://scriptftp.com/forum/viewtopic.php?f=9&t=56 didn't catch this. Any thoughts on how to correct for this situation? Is there a way to parse the verbose output inside of ScriptFTP (preferred) or outside so I can add some error correcting?
TYPE I
200 Type set to I.
MODE Z
200 MODE Z ok.
PASV
227 Entering Passive Mode (IP,7,218)
Opening data connection to IP Port: 2010
LIST -T
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
49901 bytes transferred. (51.1 KB/s) (953 ms)
Downloading................. b_Execs_20081208_COMPANY.csv
SIZE b_Execs_20081208_COMPANY.csv
213 424
PASV
227 Entering Passive Mode (IP,7,208)
Opening data connection to IP Port: 2000
RETR b_Execs_20081208_COMPANY.csv
150 Opening BINARY mode data connection for b_Execs_20081208_COMPANY.csv (424 Bytes).
226 Transfer complete.
Transfer Timeout (30s). Closing data connection.
0 bytes transferred. (0 bytes/s) (00:00:30)
CWD /d:/DAFC_APP/ftp/alaris/EXPORT
250 Directory changed to /d:/DAFC_APP/ftp/COMPANY/EXPORT
PWD
257 "/d:/DAFC_APP/ftp/COMPANY/EXPORT" is current directory.
Unfortunately some of the files I'm moving can be 0 bytes at times. Is there a way to compare the file size on the server with the received file size?
Thanks!
Hello forest,
any thoughts on how to correct for this situation? Is there a way to parse the verbose output inside of ScriptFTP (preferred) or outside so I can add some error correcting?
150 Opening BINARY mode data connection for b_Execs_20081208_COMPANY.csv (424 Bytes).In the case you posted, GETFILE should have returned an error. Could you post the complete output? Have GETFILE showed an error like this?
226 Transfer complete.
Transfer Timeout (30s). Closing data connection.
***** Cannot download file bla blaIf so, there is no need to parse the verbose output, just adding and IF after GETFILE is enough:
***** Because bla bla bla
liked Script FTP? Try our other product Email Parser
Thats the thing..GETFILE didn't return an error...otherwise my if statements would've caught it.
I'll send you the verbose output and my script but please keep each anonymous if you need to post codebits.
I'll send you the verbose output and my script but please keep each anonymous if you need to post codebits.
Hello Forest,
Thanks for the verbose output.
I've added a new command called GETFILESIZE used to retrieve local and remote file sizes. To use it you have to download and install the ScriptFTP development build:
http://www.ScriptFTP.com/files/ScriptFTP_devel_setup.exe
It is used this way:
You can also use paths along with file names:
On error this command will return a negative value, on success the size in bytes.
The topic in the scripting guide of this command will be added when ScriptFTP 3.2 will be finally released.
Regarding why GETFILE returned OK even when the transfer failed, this is because your server sent a message telling ScriptFTP that the transfer were successful (even when there was a timeout ¿?):
Thanks for the verbose output.
I've added a new command called GETFILESIZE used to retrieve local and remote file sizes. To use it you have to download and install the ScriptFTP development build:
http://www.ScriptFTP.com/files/ScriptFTP_devel_setup.exe
It is used this way:
FTP Script
- # Get the file size (in bytes) of the remote file test1.txt
- # The size is
- # Get the file size (in bytes) of the local file test2.txt
- # The size is
FTP Script
- # Get the file size (in bytes) of the remote file test.txt
The topic in the scripting guide of this command will be added when ScriptFTP 3.2 will be finally released.
Regarding why GETFILE returned OK even when the transfer failed, this is because your server sent a message telling ScriptFTP that the transfer were successful (even when there was a timeout ¿?):
(ScriptFTP) RETR b_Execs_20081208_COMPANY.csvThis may have occurred because the file changed its size while it was being downloaded, but I'm not sure.
(FTP server) 150 Opening BINARY mode data connection for b_Execs_20081208_COMPANY.csv (424 Bytes).
(FTP server) 226 Transfer complete.
(ScriptFTP) Transfer Timeout (30s). Closing data connection.
liked Script FTP? Try our other product Email Parser
I've added a new command called GETFILESIZE used to retrieve local and remote file sizes. To use it you have to download and install the ScriptFTP development build: http://www.ScriptFTP.com/ScriptFTP_devel_setup.exeHi.
When you give a development build like this, does this build contain all the changes in the previous builds the last weeks?
Lars H.
Hi Lars,
Yes, they contain all the changes.
Yes, they contain all the changes.
liked Script FTP? Try our other product Email Parser
Awesome! Thanks for the response! My clients will be way happier now. Looking forward to 3.2! I'll use the development build till then..
I wanted to post the code snippet I came up with in case it helps someone else out:
FTP Script
- ##Test to see if local and remote file matches
- GOTO :download_file1
Thanks forest.
liked Script FTP? Try our other product Email Parser
Hello everybody! I am new in the forum. Just wanted to greet you
- All times are UTC -