- InternetOpen
- InternetConnect
- FtpGetFile
- FtpPutFile
- FtpFindFirstFile
- InternetFindNextFile
- InternetCloseHandle
- Open an Internet Connection – This is to initialize the wininet API. One can use any connection name for achieving this
$InternetOpen = DllCall("wininet.dll", "long", "InternetOpen", "str", “My FTP Control”, "long", 1, "str", “”, "str", “”, "long", 0);We can keep the proxy name and proxy bypass as blank. - Connect to the server with the username and password – One need to have a username and password for the same, as well as the handle returned from the previous step
$InternetConnect = DllCall("wininet.dll", "long", "InternetConnect", "long", $InternetOpen, "str", $ServerName, "int", 0, "str", $Username, "str", $Password, "long", 1, "long", 0, "long", 0); Servername, Username, Password need to be provided. - Start the file transfer with FtpGetFile function – Filename and handle needs to be provided as the inputs
$FTPget = DllCall("wininet.dll", "int", "FtpGetFile", "long", $InternetConnect, "str", $RemoteFile, "str", $SaveLocalFile, "int", 0, "long", 0, "long", 0, "long", 0);This would save the file in the local computer with the name as provided in place of variable $SaveLocalFile. - Close both the handles
$CloseCC = DllCall("wininet.dll", "int", "InternetCloseHandle", "int", $InternetOpen)
$CloseCC = DllCall("wininet.dll", "int", "InternetCloseHandle", "int", $InternetConnect)
I have created Ftp client software with the same function, and you can download it freely by clicking here.
If you want to access the code, kindly post a request for it through the comments section. I will share the code with anyone who requires.
do you know if it's possible make an api call from AutoIT using ChangeDisplaySettingsEx that will cycle through the current monitors and for those not connected to the desktop set them to "extend" the desktop? I'm having a heck of of time getting the DllStructCreate for the DEVMOD setup properly to pass in the DMPOSITION...
ReplyDeleteI would love access to the code. I am working on somthing like this but having problems. damod@vestas.com
ReplyDeleteCould you please send me the code? I'd love to have a look at it.
ReplyDeleteThanks!
Please, could you send me the code ? I'd like to make simple application for automated FTP receive.
ReplyDeletezeka215 gmail com
Thanks
I would like to have the source code. Thank You
ReplyDeleteI created a similar script with AutoIt that also checks if the file has been uploaded correctly. Find the source here:
ReplyDeletehttp://getstreaming.wordpress.com/2011/07/06/ftp-upload-script/