Hi,
I use: ########CODE to copy and paste####### on mouseUp putemptyintofield1 put libURLftpCommand("PWD","ftp.maxvessi.net") & returnafterfield1 put libURLftpCommand("STAT","ftp.maxvessi.net") & returnafterfield1 put libURLftpCommand("CWD http://www.maxvessi.net","ftp.maxvessi.net") & returnafterfield1 put libURLftpCommand("NLST ","ftp.maxvessi.net") & returnafterfield1 put libURLftpCommand("MLSD","ftp.maxvessi.net") & returnafterfield1 put libURLftpCommand("QUIT","ftp.maxvessi.net") & returnafterfield1 end mouseUp #####END OF CODE generated by http://tinyurl.com/j8xf3xq #####
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
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)..
The solution is that you have to use the URL method:
########CODE to copy and paste####### on mouseUp putemptyintofield1 libURLSetFTPListCommand "LIST" puturlencode("user@aruba.it") into myUser putURL ("ftp://" &myUser& ":password@ftp.maxvessi.net/www.maxvessi.net/") & returnafterfield1 end mouseUp #####END OF CODE generated by http://tinyurl.com/j8xf3xq with livecode 9.0.0-dp-5#####