I dont really know C++ (programming in Delphi) but thanx for your 
help "Fastream Technologies"! Managed to make it work in delphi 
based on your code.

Thanks to your help, I discovered something interesting, and if 
anyone would have similar problem (with downloading files from 
forums keeping the orginal name of file), look at this:

When im trying to download a file from forum (entering http://...
download.php?id=....) im getting the following headers:

GET /testforum/download.php?
id=1001&sid=6c64e0d2e4ab62240ac9f4410587a166 HTTP/1.0
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, 
image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Referer: http://www.testsite.com/testforum
Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Opera 
7.54  [pl]
Host: www.testsite.com
Cookie: <censored>

GET /testforum/forumfiles/testfile.txt HTTP/1.0
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, 
image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Referer: http://www.testsite.com/testforum
Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Opera 
7.54  [pl]
Host: www.testsite.com
Cookie: <censored>

As you can see there is redirection (its kinda obvious). So the 
easiest way to recive "testfile.txt" name is just getting HTTPCLI.
DocName value OnRequestDone ;-)

Thanks again!!!
Ann

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to