Download csdb file from server through logic

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
Bhupender11
Posts: 63
Joined: May 15th, 2018, 1:18 am

Download csdb file from server through logic

Post by Bhupender11 »

Dear CSPro Team,

Can we download csdb file from server through logic.

Currently, I am using dataviewer to download data from FTP server manually.
Is there is any way to do it through program.

Thanks in advance.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Download csdb file from server through logic

Post by josh »

Absolutely. You can use the function syncdata with GET to download data from the server. The code would be something like this.
if syncconnect(CSWeb, "http://myserver.com/csweb/api") then

    syncdata(GET, MYDATA_DICT);

    syncdisconnect();

endif;
Replace the server url and dictionary names with your own.

You can add multiple calls to syncdata if you want to download multiple data files. You can put this logic in a data entry application or a batch edit application.
Bhupender11
Posts: 63
Joined: May 15th, 2018, 1:18 am

Re: Download csdb file from server through logic

Post by Bhupender11 »

Thanks josh its working through data entry application.

But how can we do it by batch file as it asking for input and output csdb file.
If possible provide me screen shots of the same.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Download csdb file from server through logic

Post by josh »

In your batch application set the type for the input and output files to "None". For the file that is associated with the external dictionary you are using in the call to sync enter the path to the data file where the downloaded cases will be put.
Bhupender11
Posts: 63
Joined: May 15th, 2018, 1:18 am

Re: Download csdb file from server through logic

Post by Bhupender11 »

ok done.
Thanks
Post Reply