This content has been marked as final. Show 3 replies
Yes, you can connect to an FTP server using the Socket class:
var socket:Socket = new Socket("localhost", 21);
I was able to use the ActionScript code posted on this blog to *connect* to an FTP server:
However, my FTP server complained when I tried to establish a passive (PASV) FTP connection ("Can't open passive connection: Address family not supported by protocol family.") I am not familiar enough with FTP commands to figure out how to upload data.
thanks this definately helps, I was able to do everything except upload the file, but I probably just need to mess with it a little more...
I wish I knew more about FTP myself so I could help you connect with a passive connection. My only suggestion is to check FTP log in Dreamweaver, which will show you everything that happens in FTP talk. Try to enable passive mode in Dreamweaver or your FTP client and see if it works, then at least you know if you can...
You should look at the FlexFTP FTP client mentioned on Ted Patrick's blog:
The source code is written for an old beta version of AIR, but it may work with some fiddling.(Among other things, change "ApolloApplication" to "WindowedApplication" in the main MXML file, and remove "import mx.rpc.soap.errors.ClientInputError;" from the pl.maliboo.ftp.invokers.LoginInv class.)
BTW, I think that to successfully upload files with FTP, you need to set the FTP server to "passive" mode (using the FTP "PASV" command).