Jump to content

Download file through internet explorer


Recommended Posts

  • Moderators

Might try this... I see you aren't using the 4th parameter of _IECreate()... This worked to open the File dialog...

#include <ie.au3>
Opt('WinTitleMatchMode', 4)
Opt('WinSearchChildren', 1)
Opt('WinDetectHiddenText', 1)
$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,0)
WinWait('classname=#32770', 'Publisher:')
If Not WinActive('classname=#32770', 'Publisher:') Then WinActivate('classname=#32770', 'Publisher:')
Sleep(250)
ControlSend('classname=#32770', 'Do you want to open or save this file?', '', "!s")

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

Weeii, that worked! thanks!!

did the same and now i get the file to the desktop!

#include <ie.au3>

Opt('WinTitleMatchMode', 4)

Opt('WinSearchChildren', 1)

Opt('WinDetectHiddenText', 1)

$WebPage = "long url to internal system"

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

WinWait('classname=#32770', 'Publisher:')

If Not WinActive('classname=#32770', 'Publisher:') Then WinActivate('classname=#32770', 'Publisher:')

Sleep(250)

ControlSend('classname=#32770', 'Do you want to open or save this file?', '', "!s")

If Not WinActive('classname=#32770', 'Save as') Then WinActivate('classname=#32770', 'Save As')

Sleep(250)

ControlSend('classname=#32770', '', '', "!s")

If Not WinActive('classname=#32770', 'Save as') Then WinActivate('classname=#32770', 'Save As')

Sleep(250)

ControlSend('classname=#32770', '', '', "!y")

Exit

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...