Session.GetFiles Method but only files older than x and recursive?

Advertisement

dakeeper
Joined:
Posts:
2

Session.GetFiles Method but only files older than x and recursive?

Hello,

I need help on a vb.net script I'm coding.
I need to download files via ftp from a server. I need to download all files older than today - 1 day. The problem is that the files are in subfolders (each day as a folder and another subfolder called 1), so that the command must be recursive.

In short: download all files older that yesterday from all folders.

Any ideas?
rgr

Reply with quote

Advertisement

dakeeper
Joined:
Posts:
2

I tried...
session.GetFiles("/home/devel/test/*<2022-04-26 23:59:59", "C:\Users\XY41743\Desktop\somefolder\", False, transferOptions)
But it's only lookin in /home/devel/test and not in /home/devel/test/1/ where the files are.

anyone?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,275
Location:
Prague, Czechia

Is that VB.NET? This should do:
Dim transferOptions As New TransferOptions
With transferOptions
    .FileMask = "*<today"
End With
    
session.GetFiles(
    "/remote/path/*", "C:\local\path\", False, transferOptions).Check()

Reply with quote

Advertisement

You can post new topics in this forum