Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
How do download a file from a EWB server project? |
Tue, Feb 13 2024 9:47 AM | Permanent Link |
Ralf Mimoun | Hi all,
I am sure that I am missing something, but I can't find anything in the forum. I have a EWB server project that accepts a GET and sends some bytes back: procedure TMainReqHandler.Download; var Stream: TMemoryStream; begin Stream := TMemoryStream.Create; try Stream.WriteUTF8String('test'); Stream.Position := 0; CurrentRequest.SendCustomContentStream(Stream, 'application/pdf; charset=binary', 'binary', 'attachment; filename=test.pdf'); // ; charset=binary finally Sream.Free; end; end; It works - kinda. I get the corrent Content-Length from the server, and I see the bytes in the Chrome development tools, all of them, but I don't get a file in my download folder. I also get a HTTP OK/200. What am I missing? |
Tue, Feb 13 2024 9:58 AM | Permanent Link |
Ralf Mimoun | I don't know if it's important, but I initate the GET request with a TServerRequest object in the client. All I set is it's URL property.
|
Wed, Feb 14 2024 1:07 PM | Permanent Link |
Ralf Mimoun | Problem solved: Using a ServerRequest simply does not work. Instead, I use window.open(URL,'_blank');. Now I have another problem but that's something for the next post.
|
This web page was last updated on Wednesday, August 14, 2024 at 02:26 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |