Page 1 of 1

Download csdb file from server through logic

Posted: March 5th, 2019, 7:04 am
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.

Re: Download csdb file from server through logic

Posted: March 5th, 2019, 1:02 pm
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.

Re: Download csdb file from server through logic

Posted: March 6th, 2019, 2:39 am
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.

Re: Download csdb file from server through logic

Posted: March 6th, 2019, 7:08 am
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.

Re: Download csdb file from server through logic

Posted: March 7th, 2019, 12:23 am
by Bhupender11
ok done.
Thanks