Check Folder and wait until file is downloaded

Hello guys,
Is there any chance to make a robot check the folder if the file is there, after being downloaded from a browser and then make some action with it ? Rename and move for example.

Thanks for any assistance.
Regards.
Martin

1 Like

Once you start the download you can use the Path Exists activity to see if the file exists at the download location.

You can then use Move File and Copy File to move the file around. Renaming can be done by using Move File with a different path. For example you could “move” it from “download.txt” to “my file.txt”.

Daniel,
The file will be created immediately after download is initiated.
The point is, to wait until the file is at his full size and after that being moved.
Not sure if Path Exists could wait until file is at full size.

Hi,
You can try with looping back to path exists activity and then if file found then you can continue with the process.

Let us know if this helps,
Regards,
Pavan H

1 Like

Use path exists activity in do while loop

And then move or whatever you want.
:slight_smile:

1 Like

Check if the file exists using path exists activity.


Then use While Loop. Loop until the path exists :slight_smile:

1 Like

Hi @Martin_Kral

Just to add to what @pavanh003 mentioned, you can use a Do While loop.

In the do while loop use path exists activity to find whether the file is available. This returns a true or false. Use that variable as the condition for the loop

3 Likes

If the place you are downloading from gives a file size you can check against that.

Otherwise you can loop and check the size every iteration. If the size gets bigger in between iterations then the file is not yet downloaded. If the connection isn’t good you could delay the loop to run only every 5 or 10 seconds so that a brief stutter in the connection won’t read as a false finished.

Here is a link to a forum discussion about telling when a file is downloaded.

2 Likes

Perhaps stupid question, but how the condition and variable should look like.


Seems it has no errors, but after execution it states “File not found”

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