Jump to content

Download file through internet explorer


Recommended Posts

in my defence i have searched the forum for over 1 hour and didn't find what i was looking for so i post here instead :-)

problem: i need to download a file through internet explorer locally on my machine automatically.

why? the webpage is active directory enabled so using IE bypasses the AD checking.

problem manifest: i can run an hidden ie by using: ;_IECreate ("$webpage", 0, 0)

then i get this annoying "File Download" box, telling me to "cancel" "save" or "open"

script:

_IECreate ("$webpage", 0, 0)

WinWaitActive("File Download" , "Do you want to open or save this file?")

Send("!s")

but the file download box just sits there...

i think this should be an easy script right? i am a newbie in this so please help :-)

Link to comment
Share on other sites

  • Moderators

Here I go jumping off into something I don't know 1st hand about... but you could try this:

_IECreate ("$webpage", 0, 0)
WinWait("File Download" , "Do you want to open or save this file?")
ControlClick('File Download', '', 'Button1');Assuming button 1 is OK or whatever you need to click.

Can you not use _InetGet() though?

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.

Link to comment
Share on other sites

none of these seems to work.

trying the InetGet i get "Error parsing function call.: "

the url is not an direct link to the document. it's a link to our document management system, so the URL is interpreted by an metaface server who in turn returns the file. So my best bet is to go trough internet explorer..

Edited by Dave668
Link to comment
Share on other sites

  • Moderators

none of these seems to work.

trying the InetGet i get "Error parsing function call.: "

the url is not an direct link to the document. it's a link to our document management system, so the URL is interpreted by an metaface server who in turn returns the file. So my best bet is to go trough internet explorer..

Why don't you show how you are using InetGet()... Error parsing function call is you calling it wrong.

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.

Link to comment
Share on other sites

I can't understand why InetGet() wouldn't work.. Are you sure you are using the correct parameters? Check the helpfile, maybe.

Kurt

PS: Smoke_N, you've finally changed your avatar! Lovin' it.

Awaiting Diablo III..

Link to comment
Share on other sites

Why don't you show how you are using InetGet()... Error parsing function call is you calling it wrong.

$WebPage = "long link to document system"; <- this link is correct!

InetGet("$WebPage", "C:\temp\")

Edited by Dave668
Link to comment
Share on other sites

Don't use " 's with your variable! so use this:

$WebPage = "long link to document system"; <- this link is correct!
InetGet($WebPage, "C:\temp\")

And it should all work.

Kurt

EDIT: Small mistake in script.

Edited by _Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

  • Moderators

So your url looks like

$WebPage = "http://www.someurl.com/somefile.exe";Notice I have the file I want to get there
InetGet($WebPage, 'C:\temp\')
?

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.

Link to comment
Share on other sites

So your url looks like

$WebPage = "http://www.someurl.com/somefile.exe";Notice I have the file I want to get there
InetGet($WebPage, 'C:\temp\')
?

No. look in my previous reply, its not a direct link. Its a "faked" url to a server. The server digs up the right doc and version based upon the URL i send it. in this case the URL is a direct linmk to the latest version of this document.

Edited by Dave668
Link to comment
Share on other sites

  • Moderators

No. look in my previous reply, its not a direct link. Its a "faked" url to a server. The server digs up the right doc and version.

Sorry ... I missed that, then yes, I would assume that would be your best bet... and I'll leave it to those here that actually use IE to help you further... GL.

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.

Link to comment
Share on other sites

I still don't know why this doesn't work:

$WebPage = "http://www.someurl.com/somefile.exe" ;Notice I have the file I want to get there
InetGet($WebPage, 'C:\temp\somefile.exe') ;Notice that I have the full name & extension of destination

?

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

  • Moderators

Look at Opt('WinTitleMatch', 4) and try to use WinExists('classname=Class<<whatever the class is under "title" in window info tool')

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.

Link to comment
Share on other sites

I still don't know why this doesn't work:

$WebPage = "http://www.someurl.com/somefile.exe" ;Notice I have the file I want to get there
InetGet($WebPage, 'C:\temp\somefile.exe') ;Notice that I have the full name & extension of destination

?

Kurt

$WebPage = "http://www.someurl.com/somefile.exe" ;Notice I have the file I want to get there <- This is not the URL to the file!! its an masked URL, the server gets the file.

otherwise this would have worked yes!!

Link to comment
Share on other sites

Ok i replicated this with a file on the internet:

$WebPage = "http://se2.php.net/get/php-5.2.1-Win32.zip/from/se.php.net/mirror"; notice this is not a direct link to a file, but it will start a download.

$oIE = _IECreate ($WebPage,0,0)

WinActivate("File Download","")

Send("!s")

all i get is this download box:

post-21422-1173692537_thumb.jpg

then the script just waits..i want to download this file directly to c:\temp or whatever.

i found some more info on this but for vb, not figured out how to do this though, also the post is old so might not be relevant.

http://www.vbip.com/forum/topic.asp?id=6882

The same behaviour can be shown with this URL "http://phpnuke.org/modules.php?name=Downloads&d_op=getit&lid=425" also not a direct link, but it gets you the file.

[EDIT: spelling errors! added a new d/l link to try]

Edited by Dave668
Link to comment
Share on other sites

Now i feel stupid, both of the links i provided actually worked the way you have suggested. But it does not work with my internal URL still. I get this in the file when trying:

"You must have Internet Explorer v5.0 or later installed to use this program!"

so the "InetGet($WebPage...." can't be used. I will see if i can find an appropriate URL.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...