Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Http file download question
Re: Http file download question [message #36693 is a reply to message #36685] Tue, 26 June 2012 11:49 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3443
Registered: August 2008
Senior Veteran
Hello Mirek

It also works using CURL. The trick is to add --ntlm option (from CURL doc: The NTLM authentication method was designed by Microsoft and is used by IIS web servers. It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts):

C:\>curl -u myusername:mypassword --ntlm -O http://myintranet/myfile.pdf -v
* About to connect() to myintranet port 80 (#0)
*   Trying 152.41.2.31...   % Total    % Received % Xferd  Average Speed   Time
   Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0co
nnected
* Connected to myintranet (152.41.2.31) port 80 (#0)
* Server auth using NTLM with user 'myusername'
> GET /myfile.pdf HTTP/1.1
> Authorization: NTLM TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAFASgKAAAADw==
> User-Agent: curl/7.21.4 (i386-pc-win32) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2
.5
> Host: myintranet
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Type: text/html; charset=us-ascii
< Server: Microsoft-HTTPAPI/2.0
< WWW-Authenticate: NTLM TlRMTVNTUAACAAAACgAKADgAAAA1gonippnZh0iAu7MAAAAAAAAAAIQ
AhABCAAAABgByFwAAAA9OAFQAQgBJAE8AAgAKAE4AVABCAEkATwABAAoAQgBOAFQANgAyAAQAGABiAGk
AbwAuAHMAZQBuAGUAcgAuAGUAcwADACQAQgBOAFQANgAyAC4AYgBpAG8ALgBzAGUAbgBlAHIALgBlAHM
ABQAQAHMAZQBuAGUAcgAuAGUAcwAHAAgAFiLFkH1TzQEAAAAA
< Date: Tue, 26 Jun 2012 09:25:02 GMT
< Content-Length: 341
<
* Ignoring the response-body
{ [data not shown]
100   341  100   341    0     0  21312      0 --:--:-- --:--:-- --:--:--  333k*
Connection #0 to host myintranet left intact
* Issue another request to this URL: 'http://myintranet/myfile.pdf'
* Re-using existing connection! (#0) with host myintranet
* Connected to myintranet (152.41.2.31) port 80 (#0)
* Server auth using NTLM with user 'myusername'
> GET /myfile.pdf HTTP/1.1
> Authorization: NTLM TlRMTVNTUAADAAAAGAAYAGoAAAAYABgAggAAAAoACgBIAAAACgAKAFIAAA
AOAA4AXAAAABAAEACaAAAANYKI4gUBKAoAAAAPUwBFAE4ARQBSADIAMwA4ADUAMwBCAFAAQwA2ADUAOA
AxAFaQ7c+fdOfVAAAAAAAAAAAAAAAAAAAAALjckI63UGzagqVOVuI+10LsuaHq+iRwvcfBV7+IIKyYlI
pwvm0d4iU=
> User-Agent: curl/7.21.4 (i386-pc-win32) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2
.5
> Host: myintranet
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/pdf
< Last-Modified: Thu, 10 Nov 2011 14:49:40 GMT
< Accept-Ranges: bytes
< ETag: "3a5dcbf9b79fcc1:0"
< Server: Microsoft-IIS/7.0
< X-Powered-By: ASP.NET
< MicrosoftOfficeWebServer: 5.0_Pub
< MS-Author-Via: MS-FP/4.0
< Date: Tue, 26 Jun 2012 09:25:02 GMT
< Content-Length: 1707881
<
{ [data not shown]
100 1667k  100 1667k    0     0  34.6M      0 --:--:-- --:--:-- --:--:-- 34.6M*
Connection #0 to host myintranet left intact

* Closing connection #0



Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Set thread priority for linux
Next Topic: [Solved]Can't show favicon.ico in Skylark if root path is not Null
Goto Forum:
  


Current Time: Tue Aug 26 04:31:26 CEST 2025

Total time taken to generate the page: 0.05728 seconds