Hi
I have a small synapse http server. It uses TTCPBlockSocket.sendbuffer (as in the example in the synapse directory) to send outputdata.
The outputdata is created this way:
st := TFileStream.Create(filename, fmOpenRead or fmShareDenyWrite);
headers.add('--' + IntToHex(Random(MaxInt),
+ '_Synapse_boundary');
headers.add('content-disposition: form-data; name="' + filename + '";'
+ ' filename="' + filename +'"');
headers.add('Content-Type: Application/octet-string');
outputdata.CopyFrom(st, 0);
And it will download the file "filename". This part works fine.
Now, I would like to also attach an html file to outputdata wich should show up on the client (browser) with a thank you message. I have the html file on disk. I can't find out how to make this work. When I simply attach the file preceded by 'Content-Type: text/plain', it gets attached but not loaded as a apage in the browser. Anybody could give me a hint?