#1 2016-05-23 17:19:56

EGovMetrics
Member
Registered: 2016-05-21
Posts: 39

Download a file from Internet

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

Offline

#2 2016-05-23 17:32:41

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Download a file from Internet

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.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.