Print Page | Close Window

Load file content to the TWebMemo

Printed From: TMS Software
Category: WEB
Forum Name: WEB Core
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=11324
Printed Date: 16 Sep 2019 at 3:04pm


Topic: Load file content to the TWebMemo
Posted By: Alex Egorov
Subject: Load file content to the TWebMemo
Date Posted: 28 Aug 2018 at 12:21pm
Hello,

Can you provide any example how to load any text file to the TWebMemo component on the web application by button click (not local file, but from the server side). Also transfer should be encrypted.

You have very good components but also you need to add many examples!



Replies:
Posted By: Bruno Fierens
Date Posted: 28 Aug 2018 at 3:40pm
If your file is available as a resource URL over HTTPS, this should take care of encryption.
You can use then the WebHttpRequest component, perform a HTTPS GET request and get the file content from the OnResponse event and fill the TWebMemo with the retrieved text.


Posted By: Alex Egorov
Date Posted: 28 Aug 2018 at 3:42pm
I mean client-server application, server side started on the Windows system


Posted By: Bruno Fierens
Date Posted: 28 Aug 2018 at 3:44pm
Over what protocol do you expect the data to be transferred if my answer to use HTTPS is not what you need?


Posted By: Alex Egorov
Date Posted: 28 Aug 2018 at 3:50pm
Question about protocol too. What I need: start my own server part on the Windows and connect from web client side to this server part and get any data stream


Posted By: Bruno Fierens
Date Posted: 28 Aug 2018 at 3:58pm
You mentioned : "load text file" and then a HTTPS GET is most simple and you need a HTTPS server for that.
Alternative could be via a HTTP REST API if you need load/save (you did not mention 'save' though)
or alternatively a websocket server.

There are samples for HTTP GET, XDATA REST API server and WebSocket connection all included in the TMS WEB Core distribution.


Posted By: Alex Egorov
Date Posted: 04 Sep 2018 at 3:11pm
Ok, this is XDataWebClientDemo? Where is server for this demo?


Posted By: Wagner R. Landgraf
Date Posted: 04 Sep 2018 at 8:50pm
The source code of server used in XDataWebClient demo is provided in XData installation, under demos folder, subfolder "simple_sqlite". But it provides data from a database, not from a test file.



Print Page | Close Window