Download latest file

Hi I am trying to download latest file and moving the file using the following but the file which is getting moved is not latest file butthe file which was downloaded earlier. How can I get latest file move to my folder

Hi @dutta.marina

Use For each file in folder activity

Or
Use this command

DirectoryInfo("yourDirectoryPath ").GetFiles().OrderByDescending(Function(f) f.LastWriteTime).First().ToString

Hope it helps
Thanks

Hi @dutta.marina

(From file In New System.IO.DirectoryInfo("C:\Users\ppaluri\Downloads").GetFiles() Order By file.LastWriteTime Descending Select file.FullName).FirstOrDefault()

Hope it helps!!

@dutta.marina

@pravallikapaluri @tazunnisa.badavide @sarvesh.b

Thanks every one. Actually the main problem was while moving the file there was no delay after downloading the file. When I inserted a delay between download and moving files it worked correctly

1 Like

hi, I am happy you got solution , but i think this solution is not permanent better you should use wait for downloads activity .
image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.