Sign in to follow this  
Followers 0
ryadical

IE UDF Download a file

8 posts in this topic

I am using the IE.au3 udf to automate a task on a website. One of the tasks I need to do is to download a file that is linked on the website. The website has a login/pass. The normal way I download a file is with InetGet which uses IE but unfortunately it does not have a way to specify the hWnd of the IE window you want to use, which means it opens a new IE session and tries to use the download link which is not valid because it is not logged in. 

I know I could click on the download link but I would rather not do it that way as I do not want to start working with controls outside of IE (the save dialog) on this particular application. 

Share this post


Link to post
Share on other sites



Have you tried InetGet in conjunction with _IECreateEmbedded()? This has worked for me in the past.

Share this post


Link to post
Share on other sites

1.

Wait... InetGet uses IE to download?

I'm so confused.

2.

Why would you have multiple browser sessions open?

You're just asking for application management strains that way.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

That seems to work. I was hoping there was a way to do it without imbeding IE but if no one else chimes in I guess I will have to do it that way.

Share this post


Link to post
Share on other sites

1.

Wait... InetGet uses IE to download?

I'm so confused.

2.

Why would you have multiple browser sessions open?

You're just asking for application management strains that way.

Yes, it does. If you read the helpfile, you will see the line: 

Internet Explorer 3 or greater must be installed for this function to work.

Since it was using IE behinds the scenes, I was hoping to tell it to use the IE window that I was controlling, not use a new session. 

Share this post


Link to post
Share on other sites

ryadical,

Not sure why the Help file says that but InetGet does NOT start an instance of IE...


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Pretty sure it's not opening an IE session.  It is more likely using the wininet.dll, and that statement ensures that wininet.dll would be installed.

Now, I will also say, that it probably uses whatever cache/cookies are currently available, so you may need to:

1. Create a non-visible IE browser using the _IECreate func.

2. Log in

3. Launch your script

4. _IEQuit() / close browsing session

1, 2 and 4, could be done in like 5 lines of code


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

@SmOke_N - I just ran a script that downloads in a loop, I did not see an instance of IE in ProcessExplorer...


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0