• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • Synchronization
      • Services
        • Overview
        • Synchronization Connection String
        • CSWeb
        • Bluetooth
        • Dropbox
        • FTP
        • Local Files
        • Syncable Name
      • Messages
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

FTP Synchronization Service

Overview
CSPro can connect to a File Transfer Protocol (FTP) server, using it as a synchronization service. After connecting to an FTP server, synchronization routines can transfer cases, files, and other data. FTP servers are useful for users conducting small- to medium-sized survey operations who are not able to configure the preeminent CSPro synchronization option, CSWeb.
CSPro can work with FTP servers using encrypted transmission via TLS/SSL. There are two modes that CSPro supports when using File Transfer Protocol Secure (FTPS): explicit and implicit. To use explicit TLS/SSL, provide a URL for the server that starts with "ftpes://". To use implicit TLS/SSL, provide a URL for the server that starts with "ftps://". For servers that do not support TLS/SSL, use a URL that starts with "ftp://". FTP over SSH (SFTP) is not supported.
FTP Connection
A connection to an FTP server occurs as a result of a syncconnect function call, or as part of a CSPro operation such as a Simple Synchronization or an application deployment.
The resource of an FTP connection string is the server URL. You can optionally specify a port number by adding it to the end of the URL, separated by a colon. For example, the URL "ftp://example.org:27" tells CSPro to connect to port 27. If no port is specified, the standard FTP port will be used: 21 for FTP or 990 for FTPS.
The username and password can also be specified in the connection string. If the username and password are not specified, the user will be prompted to enter them the first time the connection is made.
These are options that can be specified in the connection string. Note that values must be properly encoded based on the way that the connection string is defined (as a string, as a JSON object, or as a CSPro URI).
Property Name and ValuesDescription
 
"username"The user's username. This is only used if a password is also provided.
 
"password"The user's password. Hardcoding passwords in applications is not recommended. This is only used if a username is also provided.
The following are examples of how to create connections to FTP servers:
// CSPro will prompt for the username and password
syncconnect("ftpes://example.org");

// the credentials are specified using percent-encoding
// to properly account for any special characters
syncconnect(maketext(
   
"ftpes://example.org|username=%s&password=%s",
   
encode(PercentEncoding, "jackw"),
   
encode(PercentEncoding, "MyPa$$w0rd!")
));
Credential Storage
When connecting to an FTP server, the username and password are stored in the operating system's secure storage and do not need to be entered again. You can use the Manage Credentials dialog to manually clear these credentials.
Locally Run FTP Server
If you are running the FTP server on the same machine that you are using for synchronization operations, you use the Local Files synchronization service to speed up operations. Rather than connecting over the Internet to server, CSPro will directly access the contents of the server on the local machine. For example, if the root directory of the FTP server is located at C:\surveys\ftp-server, you can connect directly using:
syncconnect("file:///C:/surveys/ftp-server");
Synchronization Data Storage
Once CSPro connects to a file-based synchronization service, it looks for or creates a directory named CSPro in the root directory, using it for the results of synchronization operations. CSPro uses the following directories:
DirectoryDescription
/Files accessed using syncfile are evaluated from the root directory, not the CSPro directory.
 
/CSPro/apps/Applications deployed and used in operations such as syncapp or while updating applications.
 
/CSPro/DataSync/Case data uploaded using syncdata, and the dictionary describing it, are stored in subdirectories named using the dictionary's syncable name. For example: /CSPro/DataSync/LFS2026_DICT/data/ and /CSPro/DataSync/LFS2026_DICT/dict/.
 
/CSPro/messages/Messages sent using syncmessage or Sync.sendMessage.
 
/CSPro/paradata/Paradata logs uploaded using syncparadata or Sync.syncParadata.
See also: Synchronization Services, Synchronization Overview, Local Files Synchronization Service