Wait for download activity - large files

Hi,
I have a workflow where I have to download large excel files from web. I put wait for download and click activity inside, but it still throws error that file is not downloaded (file exists activity). The file size around 50MB. What do I do to make sure the file downloads properly?

1 Like

Hi

Hope this would help you resolve this

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

For more details on the discussion

Cheers @markosc

@markosc

Once you placed the Wait for Download activity, If you have the file size know then To Ensure it’s fully downloaded

You can do as below

Create a variable for downloaded files, write an assign activity as

FileInKB = downloadedfile.SizeInKB

Which results you the file size in KB

Already you know the file size before so you can compare with that

If you don’t know the file size before, then only way

is While loop and use Path Exists, declare a variable and set condition of while loop as PathExistsVariable <> True

Hope this may help you

Thanks

I did it like this

but don’t know why it throws me an error before it is downloaded. It throws error that it doesn’t exist immediately.

1 Like

Hi

Mention the condition as
NOT fileexists

Because only if the condition satisfies it will continue the loop else it will come out

So here until file exists the condition should not get satisfied

Cheers @markosc

Hello Mark,
For downloading large files I have this movie:

Thanks,
Cristian

Be sure to build some sort of timeout within your do while loop.
Should some error occur during download your peocess will wait indefinately (or at least untill some other threshold intervenes.

Doesn’t matter if it is 5 seconds or 5 hours, but prevent the possibility of endless loops.
Something like this which would have a 5 minute timeout:


Of course if the timeout is reached you still want to validate the file’s existence and handle that exception if relevant.

Can we have Wait for Download Activity continue even if it does not find the file as it is throwing an error even in the Try Catch Block. Any solution for this ?

That error is thrown because the time-out is reaches and the file is not yet available.

You can consider increasing the time-out from the properties panel of the Wait For Download activity.

Or

You can try the flow which is shown above in this thread by @Jeroen_van_Loon

Yes, that I know that error is coming coz of timeout.
I am asking if there is no way can have error handling around this.
I used Try Catch but that is also not helping.
I want my bot to continue even if file is not downloaded in the defined timeout.

even I apply Try Catch, it still gives same error.

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