Jump to content

Recommended Posts

Posted

Hi all

I am kind of new to autoit and requiring some help please.

I need to connect to an FTP server = Sorted

#include <File.au3>

#include <Date.au3>

#include <FTPEx.au3>

$server = '11.11.11.11'

$username = 'YES'

$pass = 'NO'

$Open = _FTP_Open('SessionName')

$Conn = _FTP_Connect($Open, $server, $username, $pass)

I need to get todays date off a file on a FTP server and make sure it's todays date if if is copy the file and then delete it.

;If there is a file - download it

if not @ERROR then

ConsoleWrite("Getting file " & $aFile[10] & @CRLF)

$Ftpp = _Ftp_Fileget($Conn, FTPFileLocation' & $aFile[10], LocalFileLocationA' & $aFile[10])

;Make a copy and rename it to NewFileName

FileCopy("LocalFileLocationA" & $aFile[10], "LocalFileLocationB")

;Copy FileLocation123.txt

FileMove("LocalFileLocationB", "LocalFileLocationC", 1)

;Delete File from FTP

$DelFTP = _FTP_FileDelete($Conn, 'FTPFileLocation' & $aFile[10])

ConsoleWrite("Executing " & "del " & 'FTPFileLocation' & $aFile[10] & @CRLF)

endif

$Ftpc = _FTP_Close($Open)

This part works as well

The part I can't get working is getting the date confirmed as todays date off a FTP server if it is todays date copy the downlaod the file.

Can anyone please help me. :mellow:

Thanks

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
×
×
  • Create New...