Check copy paste folders it's complete

Hello guys. I’m new to UiPath and i’m encountering the following problem.

I have to copy a folder to a designated path from where to give access to users to download it.
What it’s the best approach in order to find out when the download it’s completed and announce the user that he can download the folder (share folder).
The size of folders may vary from 100 MB to 5 GB, so I need to find a way when/how to be sure the download is completed.

Thanks for help.

You could use the File Exists activity in a do while loop, maybe delay the sequence every 10 seconds as it loops. If you make the output of File Exists your condition:

FileExists = False

If the size is that big, I’ll suggest increase the delay time and retry to 100 +

Hope this helps :slight_smile:

is this the activity i need to use?

Starting with v2018.2, this activity is deprecated.

I was actually thinking of this, though its called Path Exists

The problem I have had with this is that the path exists before all the files are transfered.

@sLenTT, do you copy and paste it or cut and paste? If cut & paste you are able to use this to see if the old path is gone.

Have you looked at using the File Change Trigger functionality inside Monitor Events?

You could potentially loop that with the file size output at the end each time. If the size hasn’t changed between each loop, you can assume its completed. Maybe put a 10 second delay between each loop.

It’s copy and paste. I thought using path exist also, compare size or number of files in folder. Because the folders can vary 100 MB - 5 GB i probably need a greater delay.

Here is a sample solution. You will need to download package: Bala.Reva.DirFileSize.Activities

Then you can loop through until it is completed and they have the same size. Until that point it will be an infinite loop though, so they will need exactly the same size!

DirectorySize.zip (12.5 KB)

I had come up with a very similar solution to @SJonsson

You won’t need any packages downloaded and the infinite loop shouldn’t occur as its handled in the Do While condition.

FileSizeMonitor.zip (2.4 KB)

After i start the download in the new folder, the size is updated accordingly. Let’s say i copy a file that has 1 GB, it’s show me in the new folder that the size is ok and the robot closes because they are equal, but the download keeps on going for another 10 min…

I don’t understand.

If you copy a folder, the new folder will not be the same size until the copy has been completed.

Agree with @ronanpeter that if you copy folders, the folder size will not be the same until the files have completed the pasting/transfer. Only once the files have been transferred will you see that the folders have the same size, before that there are less files on the new location, meaning that there is less data on there.

At the beginning of the transfer the folder size is updated. If i have 1 file the robot stops instantly because the size is equal. If i have 2 files waits till the second file gets started on transfer then stops. But as I said the download keeps on going. My goal is to find a way to verify when the download was finished and only then send an alert to the user that he has all the files on the share folder.

Then I am sorry, but I don’t know any other way to solve it. Sorry and good luck!

You can alternatively use the Invoke Method for copying the folder path. This will not move to the next activity until completed, however, to be sure, I have added a do while loop which will delay the bot until the source folder and new folder are of the same size. Like I say however, this may be a redundant step as I think Invoke Method only progresses on completion.

You just need to add your source folder path and the destination path to test this:

Main.xaml (15.4 KB)

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