Board index » cppbuilder » How to return a file to client by using IdHttpServer
andy Huang
![]() CBuilder Developer |
andy Huang
![]() CBuilder Developer |
How to return a file to client by using IdHttpServer2004-03-03 03:10:58 PM cppbuilder33 I can successfully pass any string to ResponseInfo->ResponseText and pass it back to client. but if i want to respond client a graphic file to download how do it do it? thanks |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2004-03-04 03:17:12 AM
Re:How to return a file to client by using IdHttpServer
"andy Huang" < XXXX@XXXXX.COM >wrote in message
Quoteif i want to respond client a graphic file to download how do it do it? TIdHTTPRequestInfo *ARequestInfo, TIdHTTPResponseInfo *AResponseInfo) { if( ARequestInfo is asking for a file ) IdHTTPServer1->ServeFile(AThread, AResponseInfo, "the full path and name of the file to send"); } Gambit |
andy Huang
![]() CBuilder Developer |
2004-03-04 09:43:38 AM
Re:How to return a file to client by using IdHttpServer
I can successfully pass any string to ResponseInfo->ResponseText
and pass it back to client. but if i want to respond client a graphic file to download how do it do it? thanks {smallsort} |
andy Huang
![]() CBuilder Developer |
2004-03-04 10:57:32 AM
Re:How to return a file to client by using IdHttpServer
so here is what i tried (assume that idhttp client to send request and use localhost to test it out), can't open file
C:etinstall.txt anyone knows what's go wrong? thanks void __fastcall TForm1::IdHTTPServer1CommandGet(TIdPeerThread *AThread,TIdHTTPRequestInfo *RequestInfo, TIdHTTPResponseInfo *ResponseInfo) { IdHTTPServer1->ServeFile(AThread,ResponseInfo,"C:\etinstall.txt"); } "Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote: Quote
|
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2004-03-04 12:05:42 PM
Re:How to return a file to client by using IdHttpServer
"andy Huang" < XXXX@XXXXX.COM >wrote in message
QuoteIdHTTPServer1->ServeFile(AThread,ResponseInfo,"C:\etinstall.txt"); Gambit |