FTP Sync

Discussions about CSEntry
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: FTP Sync

Post by arkagwa »

DEAR JOSH

IT SEEMS THIS LINK IS ALMOST USELESS http://www.csprousers.org/help/html/dat ... zation.htm PLEASE HELP WITH OTHER MATERIALS
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: FTP Sync

Post by josh »

Sorry to hear that you find the documentation on sync lacking. If you have specific feedback on what is lacking we will do our best address it in the next update.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: FTP Sync

Post by arkagwa »

Dear Josh

I have a project to work on Thursday, please just help to correct the mysyncftp.pnc and send back to me i am now totally confused and i now fail even to upload the entry to android phone, my working directories are;

ftp://ftp.research-eperts.org/CSPROSYNC/mysyncftp.pnc
ftp://ftp.research-eperts.org/UG FORM/UG FORM.pen
ftp://ftp.research-eperts.org/UG FORM/UG FORM.pff
ftp://ftp.research-eperts.org/UG FORM/UGDATA.dat

and command file below
arkagwa wrote:Dear Josh
everything is working perfect for mein FTP, expect two issues.
1.The data entry allows duplicate questionnaire id (identifier) in mobile form while same app in PC can detect duplicate identifier
2.I have entered 4 cases and iwant to download back the file to Pc but when i download it , the file with my use name is empty. How do i get the data file???

Here is my code in mynsyncftp.pnc file allocated in ftp://ftp.research-eperts.org/CSPROSYNC
[SyncFile]
Version=CSPro 6.0
AppName=UG FORM FTP
[Server]
Type=FTP
Host=ftp://ftp.research-experts.org/
Username=arkagwa
Password=***********
[Sync]
ServerPath=/%AppName%
CreateClientPath=/%AppName%
CreateClientPath=/%AppName%/Data
ClientPath=/%AppName%
Get=*.*

the other two files are located here:
ftp://ftp.research-experts.org/UG FORM FTP/UG FORM.pen
ftp://ftp.research-experts.org/UG FORM FTP/UG FORM.pff
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: FTP Sync

Post by arkagwa »

josh wrote:Sorry to hear that you find the documentation on sync lacking. If you have specific feedback on what is lacking we will do our best address it in the next update.
Now working using this file, but problem the Data file underneath UG FORM is always empty (see attached photo). where is my data stored then?? i have 3 cases entered in my mobile phone. Questionnaire id is still duplicate

[SyncFile]
Version=CSPro 6.0
AppName=UG FORM

[Server]
Type=FTP
Host=ftp://ftp.research-experts.org/
Username=arkagwa
Password=********************

[Sync]
ServerPath=/%AppName%
CreateClientPath=/%AppName%
ClientPath=/%AppName%

Get=*.*
CreateServerPath=Data
ServerPath=Data

CreateClientPath=Data
ClientPath=Data
Put=*.dat
Put=*.dat.not

NB: I am hosting my website with arvixe.
Attachments
Screenshot 2014-12-09 20.27.14.png
Screenshot 2014-12-09 20.27.14.png (136.79 KiB) Viewed 9230 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: FTP Sync

Post by josh »

Where is the data file stored on your phone? The path to the data file on the phone needs to match the ClientPath in the PNC file. Based on the following lines in your sync file:

AppName=UG FORM
...
ClientPath=/%AppName%
..
ClientPath=Data
Put=*.dat
Put=*.dat.not

CSPro is going to look for your data file(s) in the folder <name of your phone>/csentry/UG FORM/Data. If it doesn't find any files that end with .dat or .dat.not then it won't transfer anything. You can check to see if your data files are in that folder by connecting your phone to your computer via USB and browsing to that folder. My guess is that your data files are actually in a different folder on your phone, but that depends on how you set up the folder structure of your application.

As an example, I have set up a very simple pnc file that syncs the data file from the Simple CAPI example (the one that comes with CSPro) to the server. I'm using a personal fpt site that I have - ftp.teleyah.com. You can test it out yourself. The username is csprosync@teleyah.com and the password is CSProSync6.0.

On the server the folder structure is:

/
-- Simple CAPI
---- Data
------ (data files are put here)
-- SimpleCAPIFTP.pnc

On the phone/tablet the data file is in the application directory along with the .pen and .pff so the folder structure is very simple:

csentry
-- Simple CAPI
---- Simple CAPI.pff
---- Simple CAPI.pen
---- Simple CAPI.dat
---- Simple CAPI.dat.not

Here is the sync file (you can also download this from the FTP site):

Code: Select all

[SyncFile]
Version=CSPro 6.0
AppName=Simple CAPI
Description=Sync data for Simple CAPI Example

[Server]
Type=FTP
Host=ftp://ftp.teleyah.com/
Username=csprosync@teleyah.com
Password=CSProSync6.0

[Sync]
CreateServerPath=/%AppName%/Data
ServerPath=/%AppName%/Data
ClientPath=/%AppName%
Put=*.dat
Put=*.dat.not
This sync file doesn't try to download anything from the FTP server. It just finds the data files in the application directory (csentry/Simple CAPI) and uploads them to the server into the directory /Simple CAPI/Data.

Josh
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: FTP Sync

Post by arkagwa »

Screenshot 2014-12-15 13.33.41.png
Screenshot 2014-12-15 13.33.41.png (31.78 KiB) Viewed 9207 times
josh wrote:Where is the data file stored on your phone? The path to the data file on the phone needs to match the ClientPath in the PNC file. Based on the following lines in your sync file:

AppName=UG FORM
...
ClientPath=/%AppName%
..
ClientPath=Data
Put=*.dat
Put=*.dat.not

CSPro is going to look for your data file(s) in the folder <name of your phone>/csentry/UG FORM/Data. If it doesn't find any files that end with .dat or .dat.not then it won't transfer anything. You can check to see if your data files are in that folder by connecting your phone to your computer via USB and browsing to that folder. My guess is that your data files are actually in a different folder on your phone, but that depends on how you set up the folder structure of your application.

As an example, I have set up a very simple pnc file that syncs the data file from the Simple CAPI example (the one that comes with CSPro) to the server. I'm using a personal fpt site that I have - ftp.teleyah.com. You can test it out yourself. The username is csprosync@teleyah.com and the password is CSProSync6.0.

On the server the folder structure is:

/
-- Simple CAPI
---- Data
------ (data files are put here)
-- SimpleCAPIFTP.pnc

On the phone/tablet the data file is in the application directory along with the .pen and .pff so the folder structure is very simple:

csentry
-- Simple CAPI
---- Simple CAPI.pff
---- Simple CAPI.pen
---- Simple CAPI.dat
---- Simple CAPI.dat.not

Here is the sync file (you can also download this from the FTP site):

Code: Select all

[SyncFile]
Version=CSPro 6.0
AppName=Simple CAPI
Description=Sync data for Simple CAPI Example

[Server]
Type=FTP
Host=ftp://ftp.teleyah.com/
Username=csprosync@teleyah.com
Password=CSProSync6.0

[Sync]
CreateServerPath=/%AppName%/Data
ServerPath=/%AppName%/Data
ClientPath=/%AppName%
Put=*.dat
Put=*.dat.not
This sync file doesn't try to download anything from the FTP server. It just finds the data files in the application directory (csentry/Simple CAPI) and uploads them to the server into the directory /Simple CAPI/Data.

Josh

The data file is available in my phone
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: FTP Sync

Post by josh »

The data file is on your phone but as I said before, the folder that the data file is in does not match the ClientPath in your sync spec file.

From the screenshot your posted the path to the data file is: csentry/UG Form/UGDATA.dat

The ClientPath in your sync file is csentry/UG Form/Data/*.dat (this is the combined result of the commands ClientPath=/%AppName%
and ClientPath=Data).

So CSEntry looks in the folder csentry/UG Form/Data for your data file and doesn't find it there instead of looking in csentry/UG Form/ where it would find it. Please follow the last example I gave you and use the following in your sync file. This will set the client path to csentry/UG Form where the data file is located.

Code: Select all

[Sync]
CreateServerPath=/%AppName%/Data
ServerPath=/%AppName%/Data
ClientPath=/%AppName%
Put=*.dat
Put=*.dat.not
Guest

Re: FTP Sync

Post by Guest »

Josh
I declare to fail for this project i think the CSentry app is lacking something .sometimes i get error sometimes i get .dat but if i repeat the sync the file does not update
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: FTP Sync

Post by arkagwa »

DearJosh
what is the problem with this code here below. When i sync my phone gives error "An error occired while sync files, Could not change to local directory: /storage/emulated/0/csentry/UG FORM"

[SyncFile]
Version=CSPro 6.0
AppName=UG FORM
Description=Sync data for UDSM Undergraduate Evalution

[Server]
Type=FTP
Host=ftp://ftp.research-experts.org/
Username=arkagwa
Password=******************

[Sync]
CreateServerPath=/%AppName%
ServerPath=/%AppName%
ClientPath=/%AppName%
Get=*.dat

CreateServerPath=/%AppName%/data/%UID%
ServerPath=/%AppName%/data/%UID%
ClientPath=/%AppName%
Put=*.dat
Put=*.dat.not
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: FTP Sync

Post by arkagwa »

Dear Josh

The comand "create ClientPath=/%AppName%" was missing now working perfect like monster.

Thanks for your support
Post Reply