You can read the response headers in OnHeaderData. Each time this function 
is called, read and save the Client.LastResponse. Then in OnHeaderEnd you 
can examine it. You can then change the file the document to be written to. 
However as Francois has said there is no complete solution to your problem 
as HTTP is a document transport protocol rather than file transport. For 
example consider a php script like:

<?php

include "a.zip"

?>

you can learn the content type from the response header but not the file 
name a.zip.

Regards,

SZ

----- Original Message ----- 
From: "Me" <[EMAIL PROTECTED]>
To: "ICS support mailing" <[email protected]>
Sent: Friday, December 09, 2005 12:29 PM
Subject: Re: [twsocket] File download


Damn... its not working with .zip files... those are Headers sent by
me, and i need headers recived in response :/ I know i wrote it
worked before but it wasnt... it only worked with .txt or .html
file... any further help?

---- Wiadomość Oryginalna ----
Od: Fastream Technologies <[EMAIL PROTECTED]>
Do: ICS support mailing <[email protected]>
Data: Fri, 9 Dec 2005 11:21:12 +0200
Temat: Re: [twsocket] File download

> Sorry that was for response header. Here is the code I use:
>
> void __fastcall httpServerClientClass::
HTTPClientBeforeHeaderSend(TObject
> *Sender,
>
const
> AnsiString Method,
>
TStrings
> *Headers)
> {
>         /* From RFC2616
>                       | request-header = Accept
; Section
> 14.1
>                       | Accept-Charset           ; Section 14.2
>                       | Accept-Encoding          ; Section 14.3
>                       | Accept-Language          ; Section 14.4
>                       | Authorization            ; Section 14.8
>                       | Expect                   ; Section 14.20
>                       | From                     ; Section 14.22
>                       | Host                     ; Section 14.23
>                       | If-Match                 ; Section 14.24
>                       | If-Modified-Since        ; Section 14.25
>                       | If-None-Match            ; Section 14.26
>                       | If-Range                 ; Section 14.27
>                       | If-Unmodified-Since      ; Section 14.28
>                       | Max-Forwards             ; Section 14.31
>                       | Proxy-Authorization      ; Section 14.34
>                       | Range                    ; Section 14.35
>                       | Referer                  ; Section 14.36
>                       | TE                       ; Section 14.39
>                       | User-Agent               ; Section 14.43
>         */
>
>         // here headers contains all the headers as a string list
> }
>
> Best Regards,
>
> SZ
>

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

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