Kimmeh Posted June 15, 2011 Posted June 15, 2011 Hi! I am working on a small project where a part of it will want to move the newest .wmv file from my FTP server to a directory on my harddisk. #include <FTPEx.au3> $server = 'myserver' $username = 'myusername' $pass = 'mypass' $Open = _FTP_Open('MyFTP Control') $Conn = _FTP_Connect($Open, $server, $username, $pass) Local $h_Handle $aFile = _FTP_FindFileFirst($Conn, "/Folder", $h_Handle) CpnsoleWrite('$Filename = ' & $aFile[3] ) ; [3] - Creation Time High $s_LocalFile = 'd:\newestresult2.wmv' ; Needs to be the same name as in FTP _FTP_FileGet($Conn, $aFile, $s_LocalFile) ; command to move the file $FindClose = _FTP_FindFileClose($h_Handle) ; $Ftpc = _FTP_Close($Open) --- So to be clear. Every once in a while a new .wmv file will be uploaded to my server. That newest file needs to be moved to my D:/ harddisk using AutoIt. I've been trying everything, but nothing so far. I can move files from FTP to D:/, but then I have to type in the name of the file manually in the AutoIt code, which I do not want to do with using 'latest file'. I hope someone can help me with this! Thanks for your time to read.
JohnOne Posted June 15, 2011 Posted June 15, 2011 Probably want to use _FTP_ListToArrayEx() and loop through resulting array testing [x][4] (File Creation datetime) and use [x][1] (Filename) as $s_LocalFile in your call to _FTP_FileGet AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Kimmeh Posted June 15, 2011 Author Posted June 15, 2011 It's working now - Thanks a lot for your response JohnOne.
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