Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

download a file from http server

Status
Not open for further replies.

toaran

Technical User
Nov 19, 2002
8
0
0
DE
hi

i tried to download a file from a http server an save this to my HD its funcional but not if i'm behind a firewall so my question is: how can i put in the username and PW from the firewall?
this is my test code i get it from this forum

i'm a beginner in TCL :)


package require http 1.0

proc mproggy {token tot cur} {
puts -nonewline stdout "."
flush stdout
}

proc rseed {} {
return [expr int(1 + rand() * 12322)]
}

set url [lindex $argv 0]
set url " set chan [open "x[rseed].txt" w]
fconfigure $chan -translation binary
set mhandle [http_get $url -channel $chan -progress mproggy]


greetings Toaran
 
Try this discussion:
It discusses one way at least to build the proper headers for the proxy auth:
Code:
proc buildProxyHeaders {} {
    global Options
    set auth {}
    if { $Options(UseProxy)                && [info exists Options(ProxyUsername)]                && $Options(ProxyUsername) != {} } {
 set auth [list "Proxy-Authorization"                         [concat "Basic"                                [base64::encode 
$Options(ProxyUsername):$Options(ProxyPassword)]]]
    } return $auth
}

and then

::http::geturl $url -headers [buildProxyHeaders]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top