Jump to content

Move newest file


Recommended Posts

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. :huh2:

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...