Jump to content

Urldownloadtofile & Proxy


tuape
 Share

Recommended Posts

Hi,

Is there any way to make URLDownLoadToFile work with proxy? I know the IP address of our proxy.

If not, will this be added to future releases?

Currently I'm using perl scripts when accessing the net from workplace since you can define proxy via $browser->proxy(http => 'http://ip-address here'); statement.

Link to comment
Share on other sites

Hi There,

As far as i know AutoIt's function URLDownloadToFile uses Internet Explorer to download files.

So if the proxy is setup in Internet Explorer it should work.

Good Luck

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

Here it is:

;=============================================================================== 
; 
; Description:    Download a file using an alternative way. 
; Syntax:          URLDownloadEx($Url, $File, $state)
; Parameter(s):  $Url        - The URL of the file on the Web 
;                  $File        - The full path of the filename.
;                  $state      - Progressbar: visible or hidden; 0 or 1
;                    
; Requirement(s):   - AutoIt v3.0.102 
;                  - iOpus File & Web Page Downloader: http://www.iopus.com/downloader.htm 
;
; Return values:    On Success: @error will be set to 0
;                  On Failure: @error will be set to 1
; 
; Note(s):        The iOpus File & Web Page Downloader should be in the same folder as the script. 
; 
;=============================================================================== 
Func URLDownloadEx($Url, $File, $state)
    Opt("WinWaitDelay", 5) 
    Opt("WinTitleMatchMode", 2) 

    $Err = URLDownloadToFile($Url, $File) 
    If $Err = 0 Then 
       $Title = "iOpus" 
       Run(@ScriptDir & '\download.exe -download "' & $Url & '" "' & $File & '"') 

       If Not WinExists($Title, "") Then WinWait($Title, "") 
        
       If $state = 1 Then WinSetState($Title, "", @SW_HIDE) 
        
       Sleep(500) 
       If ProcessExists("download.exe") Then 
           Sleep(1000) 
           $Content = ControlGetText($Title, "", "Static3") 
           If StringInStr($Content, "0 bytes") >= 1 Then 
              ProcessClose("download.exe") 
           Else 
              If ProcessExists("download.exe") Then ProcessWaitClose("download.exe") 
           EndIf 
       EndIf 

       If Not FileExists($File) Then 
          SetError(1) 
          Return 
       EndIf 

    EndIf 

    SetError(0)
    Return 0

EndFunc
Link to comment
Share on other sites

Hi There,

As far as i know AutoIt's function URLDownloadToFile uses Internet Explorer to download files.

So if the proxy is setup in Internet Explorer it should work.

Good Luck

Andre

<{POST_SNAPBACK}>

No, does not work here. Maybe it's because we use automatic proxy configuration script in IE? Edited by tuape
Link to comment
Share on other sites

Here it is:

;=============================================================================== 
; 
; Description:      Download a file using an alternative way. 
; Syntax:           URLDownloadEx($Url, $File, $state)
; Parameter(s):     $Url         - The URL of the file on the Web 
;                   $File        - The full path of the filename.
;                   $state       - Progressbar: visible or hidden; 0 or 1
;                     
; Requirement(s):   - AutoIt v3.0.102 
;                   - iOpus File & Web Page Downloader: http://www.iopus.com/downloader.htm 
;
; Return values:    On Success: @error will be set to 0
;                   On Failure: @error will be set to 1
; 
; Note(s):          The iOpus File & Web Page Downloader should be in the same folder as the script. 
; 
;=============================================================================== 
Func URLDownloadEx($Url, $File, $state)
    Opt("WinWaitDelay", 5) 
    Opt("WinTitleMatchMode", 2) 

    $Err = URLDownloadToFile($Url, $File) 
    If $Err = 0 Then 
       $Title = "iOpus" 
       Run(@ScriptDir & '\download.exe -download "' & $Url & '" "' & $File & '"') 

       If Not WinExists($Title, "") Then WinWait($Title, "") 
        
       If $state = 1 Then WinSetState($Title, "", @SW_HIDE) 
        
       Sleep(500) 
       If ProcessExists("download.exe") Then 
           Sleep(1000) 
           $Content = ControlGetText($Title, "", "Static3") 
           If StringInStr($Content, "0 bytes") >= 1 Then 
              ProcessClose("download.exe") 
           Else 
              If ProcessExists("download.exe") Then ProcessWaitClose("download.exe") 
           EndIf 
       EndIf 

       If Not FileExists($File) Then 
          SetError(1) 
          Return 
       EndIf 

    EndIf 

    SetError(0)
    Return 0

EndFunc

<{POST_SNAPBACK}>

Thanks Slim, I had already found that. But like everyone else I would like an option that does not use 3rd party software :ph34r:
Link to comment
Share on other sites

Any comments? How UrlDownLoadToFile should actually work? What about users that are not using IE and have not made the proxy settings there?

The bottom line is that this does not work for me and I have an automatic proxy configuration script in use.

Link to comment
Share on other sites

With Proxy Microsoft isa server don't work .

Regards

<{POST_SNAPBACK}>

I don't quite understand how this relates to UrlDownLoadToFile not working...sorry. Maybe one of the developers would give me an answer:

1. How can I get UlrDownloadToFile to work with proxy

2. If it's not possible, is there any plans to make UlrDownloadToFile function enhancements like adding an optional parameter that would take either proxy servers ip-address or network name.

Link to comment
Share on other sites

How can I get UlrDownloadToFile to work with proxy

<{POST_SNAPBACK}>

Set the proxy info in Internet Explorer.

I just tested this myself with the ad-blocking proxy that I use, and it worked fine.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Set the proxy info in Internet Explorer.

I just tested this myself with the ad-blocking proxy that I use, and it worked fine.

<{POST_SNAPBACK}>

Can't do that since we have an automatic proxy configuration script in use. This can be changed, but only for a short period of time:

IE settings are back to company's default as soon as I restart the browser.

Of course I could do a script that changes those settings every time I open IE, but that's not what I'm asking.

It seems to me that the answer to question 1 is:

Yes, UrldownLoadToFile works with proxy if you have made the proxy settings in IE AND you are not using automatic proxy configuration script.

How about question 2? Do you think an optional parameter would be worth it? I mean, only a small portion of users will ever experience these problems. Would be cool to have that option, though. :ph34r:

Link to comment
Share on other sites

How about question 2? Do you think an optional parameter would be worth it? I mean, only a small portion of users will ever experience these problems. Would be cool to have that option, though. :ph34r:

<{POST_SNAPBACK}>

I'm guessing it won't be built into AutoIt since the small users who it does affect could use some 3rd party program as a "helper" app and connect to a proxy for download that way.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Can't do that since we have an automatic proxy configuration script in use. This can be changed, but only for a short period of time:

IE settings are back to company's default as soon as I restart the browser.

Of course I could do a script that changes those settings every time I open IE, but that's not what I'm asking.

It seems to me that the answer to question 1 is:

Yes, UrldownLoadToFile works with proxy if you have made the proxy settings in IE AND you are not using automatic proxy configuration script.

How about question 2? Do you think an optional parameter would be worth it? I mean, only a small portion of users will ever experience these problems. Would be cool to have that option, though. :ph34r:

<{POST_SNAPBACK}>

At work I'm exactly in your position.

Download iOpus Web Downloader and use my script above.

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