Download a file from Internet


Joseph Caristena

Hi,
Sometimes it can be useful to download a simple txt file
or json file from the admin's website and save it in the following path:

app/files/variables.txt

or

app/files/variables.json

Once downloaded these files can be viewed as
the samples called LoadVars and LoadVars2.

In this way you can send daily news and more.

How can I do this ?

Thanks
Joseph Caristena


DecSoft

Hello Joseph,

If you plain to use text files which contains App Builder variables consider the "ParseVariables" action instead the "LoadVariables" action. The first one wanted an string (instead of a file path) who can be provided by an HTTP call response from our server. That is, instead of download a file, perform an HTTP call to the server and use their response with the "ParseVariables" action.

If you want to play with JSON, in fact we no need to do nothing except the HTTP call. Then in the server response (already put in the HttpClient control Response variable) we have the JSON object ready to be used. Take a look at the "JSON*" includes samples and in particular to the "JSON3" app sample.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.