• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
        • SyncConnect Function
        • SyncConnect Function (CSWeb)
        • SyncConnect Function (Bluetooth)
        • SyncConnect Function (Dropbox)
        • SyncConnect Function (LocalDropbox)
        • SyncConnect Function (LocalFiles)
        • SyncConnect Function (FTP)
        • SyncServer Function
        • SyncDisconnect Function
        • SyncData Function
        • SyncFile Function
        • SyncMessage Function
        • SyncParadata Function
        • SyncApp Function
        • SyncTime Function
        • GetBluetoothName Function
        • SetBluetoothName Function
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

SyncConnect Function (FTP)

This page describes the syncconnect function when connecting to an FTP server. For generalized information on the function, see the documentation for the syncconnect function.
Format
b = syncconnect(FTP,ftp_urlʃ,usernameʃ,passwordʅʅ);
Description
The syncconnect function opens a connection to an FTP server to synchronize data and files over the Internet. The first argument must be the keyword FTP. The second argument, ftp_url, is a string expression of the full URL of the FTP server. The third and fourth arguments, username and password are optional string arguments of the credentials used to login to the server. If the username and password are not specified, the user will be prompted to enter them the first time the synchronization is run. After the credentials have been entered the first time, they are saved in secure storage on the device and do not need to be entered again. You can use the CSPro Settings dialog to clear any cached credentials.
CSPro synchronization can work with FTP servers using encrypted transmission via TLS/SSL. There are two modes that CSPro supports for encrypted FTP: 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.
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://myserver.com:27" tells CSPro to connect to port 27. If no port is specified, the standard FTP port will be used (port 21 for FTP or port 990 for FTPS).
Note: If the attempt to establish an internet connection was unsuccessful, CSPro will alert you with an error message. If you wish to preempt this error message in order to handle this situation on your own, use the Connection Function.
Example
string ftpServerUrl = "ftpes://myserver.org";

// connect to the FTP server
if syncconnect(FTP,ftpServerUrl) then

   
// send the latest cases to the FTP server
    syncdata(PUT,SURVEY_DICT);

   
syncdisconnect();

endif;
See also: Synchronization Overview, SyncConnect Function, SyncConnect Function (CSWeb), SyncConnect Function (Bluetooth), SyncConnect Function (Dropbox), SyncConnect Function (LocalDropbox), SyncConnect Function (LocalFiles), Connection Function