Script

FTP

The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

MENU MENU
Post a message here if you find anything wrong in ScriptFTP.
Hello,

I have problem with one of my server FTP.
I use script
FTP Script
  1. VERBOSE(ON)
  2. $serwer="ftpserver"
  3. $user_in="username"
  4. $pass_in="password"
  5. OPENHOST($serwer,$user_in,$pass_in)
  6. CHDIR("test")
  7. LOCALCHDIR("c:\edi\seb")
  8. PUTFILE("test1.txt")
  9. $result=GETLIST($list,REMOTE_FILES)
  10. FOREACH $item IN $list
  11.     $result=GETFILE($item)
  12. GETFILE("*.*")
  13. GETFILE("test1.txt")
  14.  
I put file test1.txt on serwer to folder "test" (it is ok)
But in next step I can't get
-files list (GETLIST)
-all files (GETFILE("*.*")
-file "text1.txt" which is on the server

When I am using DOS or Windows Commander the "text1.txt" file is on the server and I can download him without the problem.
Did anybody have such a problem?
I noticed, that on the ScriptFTP ver 3.2 (which I am using) my script not work. When I use the ScriptFTP ver 3.3 command GETFILE work but only when I will give the file name (GETFILE("test1.txt")). GETLIST still not work :? .

Logs:
ver 3.2
GETFILE("test1.txt")
TYPE I
200 Type set to I.
PASV
227 Entering Passive Mode (84,37,x,x,235,238).
Opening data connection to 84.37.x.x Port: 60398
LIST
150 Opening BINARY mode data connection.
155 bytes transferred. (3.21 KB/s) (47 ms)
226-Directory has 4,815,458,304 bytes of disk space available.
226 Transfer complete.
***** GETFILE Error #12011: test1.txt not found.
CWD /gsdfasttrack/test
250 CWD command successful.
PWD
257 "/gsdfasttrack/test" is current directory.

ver 3.3
GETFILE("test1.txt")
Downloading................. test1.txt
SIZE test1.txt
213 10
TYPE I
200 Type set to I.
PASV
227 Entering Passive Mode (84,37,x,x,236,16).
Opening data connection to 84.37.x.x Port: 60432
RETR test1.txt
150 Opening BINARY mode data connection.
10 bytes transferred. (49 bajtów/s) (203 ms)
226 Transfer complete.
CWD /gsdfasttrack/test
250 CWD command successful.
PWD
257 "/gsdfasttrack/test" is current directory.


GETFILE("*.*") and GETLIST($list,REMOTE_FILES) in both ScriptFTP version 3.2 and 3.3 looks like this:
GETFILE("*.*")
TYPE I
200 Type set to I.
PASV
227 Entering Passive Mode (84,37,x,x,236,92).
Opening data connection to 84.37.x.x Port: 60508
LIST
150 Opening BINARY mode data connection.
155 bytes transferred. (3.21 KB/s) (47 ms)
226-Directory has 6,022,537,216 bytes of disk space available.
226 Transfer complete.
CWD /gsdfasttrack/test
250 CWD command successful.
PWD
257 "/gsdfasttrack/test" is current directory.

GETLIST(REMOTE_FILES)
Getting file listing of current remote directory
PASV
227 Entering Passive Mode (84,37,x,x,236,93).
Opening data connection to 84.37.x.x Port: 60509
LIST
150 Opening BINARY mode data connection.
155 bytes transferred. (2.40 KB/s) (63 ms)
226-Directory has 6,022,537,216 bytes of disk space available.
226 Transfer complete.
Found 0 files.
Hello rhenus,

please check whether you have the execute permission for the subfolder "/test" on the ftp server.
(test.....................drwxr-xr-x)

The x-permission for folders means you have the right to list and search its contents.
If not present any list command or wildcards will fail.
Hello,

When I'm logining to server from DOS and I'm using command ls:
ftp> ls -la
03-31-2010 02:03PM <DIR> in
03-31-2010 01:50PM <DIR> out
03-29-2010 03:04PM <DIR> test
ftp>

Am I not managing this server, I don't know how differently I could inspect it?
If there were no x-permission for folders it I think that from DOS I could also not list of files.
ftp> ls -la
03-31-2010 02:23PM <DIR> in
03-31-2010 01:50PM <DIR> out
03-29-2010 03:04PM <DIR> test

ftp> cd test
ftp> pwd
257 "/gsdfasttrack/test" is current directory.
ftp> ls -la
03-26-2010 04:19PM 48032 aaaaa.reg
03-24-2010 04:15PM 74 ping.txt
03-29-2010 01:19PM 10 test1.txt

ftp> mget *.*
#######################

Meanwhile from DOS I can download the list of files and I can download all files without giving them names (mget *.*).
My script worked from over of year and suddenly stopped. I think that it is some problem on the side of the server. But how earlier I already recalled I am not managing it server. I cannot only understand why from this server I can download files with other programs so as "Windows Commander", "CuteFTP client", "SmartFTP client" and even from DOS.