How to confirm that a file is completely downloaded

activities

#1

I am using ui path to download a file from a website and for my next activity I need to wait till it downloads ,so is there any way to know if it is completely downloaded.


#2

Hi,

May not be right solution but working fine though :wink:
Thought of many workaround but not 100% efficient.
How about keeping an eye on progress bar :stuck_out_tongue:

  • Go to download (ctl+j)
  • check whether download started or not (image exist on progress bar)
  • once started then look for progress bar to vanish (Wait Image Vanish)

Browser: Chrome


Excel Application Scope help
#3

thanks for the reply @ddpadil , but in my case the download size is very big and it’s taking a lot of time to download so if i use this flow I will have to make sure that download window is open and wait till the download gets completed.
but i am looking for a solution that will monitor in background and notify me if it gets completed.
so that meanwhile I can do other activities.
Is it possible??


#4

oh :frowning:
thought of another approach:

  • Get the new file which is downloaded
  • Try to open it eventually its gives error if its still in progress else the file will be processed this is how you can validate the confirmation of file download.
  • But here is a catch what if you next activity(entire post workflow) get over before i check the file status of the downloading file(as you mentioned it take a lot of time to download).
    Are you using monitor event (user assistance agents) i guess it doesn’t make any sense as you wants to know status background.

@ovi @aksh1yadav any ideas :thinking:


#5

@ddpadil
actually I think for this also I need to open the file location all the time so that i can loop over that file opening activity as let say in every 5 min it will try to open the file and continue the loop if error comes …
but as i said download can take a lot of time and i want to do other activities simultaniously .
I dont want to just look at one window until download gets completed.
and I am not using any monitor event activity instead i was using while loop to check the image exist as ur first reply.
will that monitor event activity help in my case?


#6

Is your file having the same name as filename while download is in progress? If not, you could keep checking for file exists (if you know the file name) in that folder, once found go to your next activity.


#7

I was thinking the same because when your file is being downloaded, at least in Firefox, the file name is something like filename.part. It basically changes the extension and once it completes the download, it changes to the original file extension.


#8

If not by filename you can go by file size. When the file isn’t downloaded yet, it usually is 0kb.


#9

I don’t think so. :stuck_out_tongue:
When file is being downloaded then its file size keep on changing.
Checking file extension would be reliable solution .


Access IE save notification in the background
#10

ya , actually I am able to do it by checking the .part extention
thanks to all for your valuable reply:grinning::grinning:


#11

@kamal,

Hi kamal , you have to use do while loop for check element exists . If you are using IE browser
Its will be popup once download is completed . You have to check continuously till the element exists. Once the element exists the loop will be stopped. Thanks


#12

Hey @kamal!

Do you know the name of the file you are downloading?

If you do, go with File.exists. Wrap it in a loop and wait for the file to be downloaded. It works like a charm.

Be careful not set up an infinite loop that might stop your automation. You need to consider if something can go wrong during download.

This is much better than using image/element exists/vanish.

Best Regards,
Bernardo