Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 7 of 7 total |
Sending a file from the client |
Mon, Oct 19 2020 9:50 PM | Permanent Link |
Paul Coshott | Hi All,
I need to send a csv file to the server. I am using TMS's XData to build my rest server and it expects to receive a TStream. What do I need to do to send the csv file over using a TServerRequest component? Thanks, Paul |
Tue, Oct 20 2020 4:00 AM | Permanent Link |
Walter Matte Tactical Business Corporation | Paul
It may land in the XData server as a TStream - but it is probably transfered as encoded binary or byte array and isn't XData all JSON?? I don;t know have not used. But if it is you should be able to see the JSON package via Fiddler. You need to to a test and use Fiddler and capture a small transaction that you want to reproduce from an EWB web app. In Fiddler you should see all the header and data (json) being sent to XData - then you can see if / how to do that with EWB. Walter |
Tue, Oct 20 2020 9:53 AM | Permanent Link |
Paul Coshott | Hi Walter,
Thanks for answering. In XData I can do the following: procedure TMyService.ReceiveFile(Content: TStream); and then save the TStream to a file. I'm just not sure how to send the file from EWB using a TServerRequest. So how would I transfer as encoded binary or byte array? Thanks, Paul |
Wed, Oct 21 2020 6:46 AM | Permanent Link |
Walter Matte Tactical Business Corporation | Paul:
Do you want the client to upload a file? There is a demo on uploading a file. I put a TFileComboBox on a THTMLForm - Method - fmPost. They select the file via TFileComboBox. Another button is clicked that HTMLForm.Submit. This start the file upload. You can put other controls - edit boxes on the THTMLForm and they are uploaded to. So Editboxes that are Visible = Flase - can contain other information that gets Posted (sent) to the Server. I don't know if this helps for th especifics of XData. Walter |
Wed, Oct 21 2020 6:46 AM | Permanent Link |
Walter Matte Tactical Business Corporation | Paul:
Do you want the client to upload a file? There is a demo on uploading a file. I put a TFileComboBox on a THTMLForm - Method - fmPost. They select the file via TFileComboBox. Another button is clicked that HTMLForm.Submit. This start the file upload. You can put other controls - edit boxes on the THTMLForm and they are uploaded to. So Editboxes that are Visible = Flase - can contain other information that gets Posted (sent) to the Server. I don't know if this helps for th especifics of XData. Walter |
Wed, Oct 21 2020 9:52 AM | Permanent Link |
Paul Coshott | Walter Matte wrote:
>> I put a TFileComboBox on a THTMLForm - Method - fmPost. Hi Walter, I'm not sure, but maybe this could work. I was hoping I could do it with a TServerRequest, in the same way I have sent other data to the server. Cheers, Paul |
Wed, Oct 21 2020 11:47 AM | Permanent Link |
Raul Team Elevate | On 10/21/2020 9:52 AM, Paul Coshott wrote:
> I'm not sure, but maybe this could work. I was hoping I could do it with a TServerRequest, in the same way I have sent other data to the server. > As mentioned before form submit option will work. Otherwise see for example this thread for solution that would allow one to drag and drop file and then you get it as base64 and use TServerRequest https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_demos&page=1&msg=210#210 More is coming in EWB3 (FileAPI support) but that is all that's possible today in EWB2 AFAIK (unless you craft some even custom json yourself ) Raul |
This web page was last updated on Thursday, April 18, 2024 at 10:42 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |