Hi All
I am playing with the ICS WebServ server demo and need some help. I want
to use the user inputs received from form.htm and based on the user
responses provide a file to the web client for download. When the user
types "one" in the first name field as example, I want the server to send
him a file (not a html page) and therefore expect the clients browser to
bring up a save file dialog automatically. This is what I have in mind:
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
*}
{ This will process posted data for
}
{ Data is saved in FormHandler.txt
}
procedure TWebServForm.ProcessPostedData_FormHandler(
ClientCnx : TMyHttpConnection);
var
Stream : TStream;
FileName : String;
FirstName : String;
LastName : String;
HostName : String;
Buf : String;
Dummy : THttpGetFlag;
begin
{ Extract fields from posted data. }
ExtractURLEncodedValue(ClientCnx.FPostedDataBuffer, 'FirstName',
FirstName);
ExtractURLEncodedValue(ClientCnx.FPostedDataBuffer, 'LastName',
LastName);
If FirstName:= 'one' then ----------now send him the file one.exe
If FirstName:= 'two' then ----------now send him the file two.exe
Your help is highly appreciated.
Regards
Juri Keyter
--
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