felixli93 Posted May 29, 2009 Share Posted May 29, 2009 hey guys, I want to make a script to send and receive data from / to an ftp server. Sending Requets to the server works just fine, but i don't get an answer my code until now: $IpServer = TCPNameToIP ("xxx.bplaced.net") $Port = 21 $SendingSocket = TCPConnect ($IpServer, $Port) If @error Then MsgBox (48, "Error", "Error creating Socket to "&$IpServer&@CRLF&"Error code: "&@error) Exit EndIf TCPSend ($SendSocket, "my message to the server (this works just fine i think)") so with this code i can send requests to the ftp-server, but it doesn't answer i guess, i have to set up a socket that listens to the ftp-server i tried this out: $portIn = 2700 $RecvSocket = TCPListen ($IpServer, $portIn) If @error Then MsgBox (48, "Error", "Error creating Socket"&@CRLF&"Error code: "&@error) Exit EndIf but this TCPListen command does always return errorcode 10049 maybe it is because of the port (i chose a random one, here 2700)? what do I have to do to properly receive data from this ftp-server for example: FileZilla (ftp-program) sends / receives the following data: Function SendTo: "=............xxx.bplaced.net....."Function RecvFrom: "=............xxx.bplaced.net..............[..N.#5"Function Recv: "220 Welcome to bplaced, FTP server standing by ....." when i start my script, it does also send / receive the first 2 messages from / to the server but it doesn't receive the 3rd message how can I make the script receiving data from an Ftp-Server? Link to comment Share on other sites More sharing options...
martin Posted May 29, 2009 Share Posted May 29, 2009 hey guys, I want to make a script to send and receive data from / to an ftp server. Sending Requets to the server works just fine, but i don't get an answer my code until now: $IpServer = TCPNameToIP ("xxx.bplaced.net") $Port = 21 $SendingSocket = TCPConnect ($IpServer, $Port) If @error Then MsgBox (48, "Error", "Error creating Socket to "&$IpServer&@CRLF&"Error code: "&@error) Exit EndIf TCPSend ($SendSocket, "my message to the server (this works just fine i think)") so with this code i can send requests to the ftp-server, but it doesn't answer i guess, i have to set up a socket that listens to the ftp-server i tried this out: $portIn = 2700 $RecvSocket = TCPListen ($IpServer, $portIn) If @error Then MsgBox (48, "Error", "Error creating Socket"&@CRLF&"Error code: "&@error) Exit EndIf but this TCPListen command does always return errorcode 10049 maybe it is because of the port (i chose a random one, here 2700)? what do I have to do to properly receive data from this ftp-server for example: FileZilla (ftp-program) sends / receives the following data: when i start my script, it does also send / receive the first 2 messages from / to the server but it doesn't receive the 3rd message how can I make the script receiving data from an Ftp-Server? Use advanced search, search for ftp in example scripts, search in titles only. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
felixli93 Posted May 30, 2009 Author Share Posted May 30, 2009 I tried out This before, but it doesn't seem to work_FTPOpen returns 13369348 (should be alright)but _FTPConnect always returns 0 and sets error to 1 Link to comment Share on other sites More sharing options...
felixli93 Posted June 3, 2009 Author Share Posted June 3, 2009 *push* Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now