Automatic data download

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
pinkcity
Posts: 2
Joined: April 16th, 2021, 5:59 am

Automatic data download

Post by pinkcity »

Hi,

Data download from the FTP server, Can this process will be an automatic process. can we have a script, that we use in the program and data will automatically download on the laptop?

Regards,
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Automatic data download

Post by aaronw »

Sure, I've written a batch app to upload data before (see below). You'd just need to modify it and use Windows scheduler to run the PFF.
https://en.wikipedia.org/wiki/Windows_Task_Scheduler
PROC UPLOAD_LOOKUP_DATA_FF

if not syncconnect(CSWeb, serverURL) then
    errmsg
("Error connecting to CSWeb server: %s", serverURL);
else

    when syncdata
(PUT, ASSIGNMENTS_DICT);
         
true  -> errmsg("Synced assignments (%d cases) to %s", countcases(ASSIGNMENTS_DICT), serverURL);
         
false -> errmsg("Error syncing assignments to %s", serverURL);
   
endwhen;

   
syncdisconnect();

endif;
pinkcity
Posts: 2
Joined: April 16th, 2021, 5:59 am

Re: Automatic data download

Post by pinkcity »

Thanks, but I want to download it from the FTP server. Can you please give some example and help

Regards,
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Automatic data download

Post by Gregory Martin »

The sync functions are the same once you've connected. Instead of using CSWeb in the syncconnect call, you can connect using syncconnect(FTP, ...).

Another option is to use Data Viewer to download your data. When you do this, you'll get a .pff file that contains the information needed to update the data file. If you run this .pff, or add it to the Task Scheduler, you should be able to keep your data updated.
Post Reply