Jump to content
Sign in to follow this  

Get todays Date off a file on a FTP server

Recommended Posts

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 = ''

$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)


$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:


Share this post

Link to post
Share on other sites

you can use the date macros (@Mday, @Mon, @Year depending on the format of the date in the file) and compare them to the date you find in the file



My Android cat and mouse game

We're gonna need another Timmy!

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...