FTP 425 No data connection

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

FTP 425 No data connection

Post by MaxV » Wed Mar 01, 2017 6:26 pm

Hi,
I use:
########CODE to copy and paste#######
on mouseUp
put empty into field 1
put libURLftpCommand("PWD","ftp.maxvessi.net") & return after field 1
put libURLftpCommand("STAT","ftp.maxvessi.net") & return after field 1
put libURLftpCommand("CWD http://www.maxvessi.net","ftp.maxvessi.net") & return after field 1
put libURLftpCommand("NLST ","ftp.maxvessi.net") & return after field 1
put libURLftpCommand("MLSD","ftp.maxvessi.net") & return after field 1
put libURLftpCommand("QUIT","ftp.maxvessi.net") & return after field 1
end mouseUp
#####END OF CODE generated by http://tinyurl.com/j8xf3xq #####

and I get:

Code: Select all

257 "/" is your current location
211 https://www.pureftpd.org/
250 OK. Current directory is /www.maxvessi.net
425 No data connection
425 No data connection
221 Logout.
What is wrong in my code?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: FTP 425 No data connection

Post by shaosean » Thu Mar 02, 2017 11:24 am

You are requesting a directory listing, and FTP passes that listing, as well as file transfers, over another connection - the data connection (basically, just another port).. Take a look at the libURLSetFTPListCommand command, as I believe that will do all the work for you (I could be wrong, as I ended up writing my own FTP library to overcome the faults of the built-in library)..

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: FTP 425 No data connection

Post by MaxV » Thu Mar 02, 2017 7:14 pm

The solution is that you have to use the URL method:

########CODE to copy and paste#######
on mouseUp
put empty into field 1
libURLSetFTPListCommand "LIST"
put urlencode("user@aruba.it") into myUser
put URL ("ftp://" &myUser& ":password@ftp.maxvessi.net/www.maxvessi.net/") & return after field 1
end mouseUp
#####END OF CODE generated by http://tinyurl.com/j8xf3xq with livecode 9.0.0-dp-5#####

This way you get:

Code: Select all

drwxr-xr-x   19 18714984   users              33 Feb 28 01:12 .
dr-xr-xr-x    2 18714984   users               3 Feb 16  2015 ..
-rwxr-xr-x    1 18714984   users            2338 Aug  2  2011 LogoLogo.jpg
drwxr-xr-x    6 18714984   users              14 Jun 19  2014 ale
drwxr-xr-x    2 18714984   users               8 Jan 31  2014 android
drwxr-xr-x    3 18714984   users              36 Jan 31 12:20 archimede
drwxr-xr-x    4 18714984   users              55 May 14  2016 battesimo
-rwxr-xr-x    1 18714984   users            3150 Sep 23  2009 canvas.html
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Internet”