English Germany
Stable, Safe, Performat.

What is FTPDirect?

FTPDirect is a software for synchronizing local and remote FTP directories. Once configuried, you can synchronize your projects one-sidedly or two-sidedly at the push of a button oder fully automatically - by setting a certain synchronization interval.

Reference: Function Calls

 

1 What are Function Calls?

Function Calls are provided functions by using FTPDirect's synchronization mechanisms out of other programs or scripts.

 

2 How are Function Calls called?

Function Calls are passed to FTPDirect.exe as arguments.

Recommended: Add the FTPDirect installation directory to your PATH variable:

In the following examples "C:\Program Files\FTPDirect" is assumed as installation directory.

2.1 Examples


2.1.1 Synchronizing a project

The following command performs an update on the project "MyProject". When synchronization is complete

the result is displayed in a separate window. The user still has the opportunity to intervene in the synchronization.

When the user
closes the window, the function is exited.

ftpdirect -call="synchronizeProject('MyProject','UPDATE',FALSE)"

 

2.1.2 Importing a project file

If you want to perform the synchronization by using FTPDirect, you must import a synchronization directory and the

corresponding FTP server information in FTPDirect. Later, you can then perform the synchronizations using the "synchronizeProject" Function Call.

ftpdirect -call="importProject('C:\temp\MyProject.ftpproj',TRUE)"

 

2.1.3 Exporting a project file

By the following call a project from FTPDirect is exported.

ftpdirect -call="exportProject('MyProject','C:\temp\MyProject.ftpproj',TRUE)"

 

2.1.4 Supress errors

By default, when it comes to errors of FTPDirect, message boxes appear, containing the appropriate error messages.

In the following example, this behavior is suppressed.

ftpdirect -call="importProject('C:\temp\MyProject.ftpproj',TRUE)" -suppress_errors

 

 

3 Function Call overview

Below you will find an overview of all available function calls.

Function name
Parameter
Available since
Description
synchronizeProject

ProjectName : String
Mode : String
AutoSync: Boolean

1.17

This function synchronizes an already imported/available project.

The parameter "Mode" describes the sync direction. Possible values:

  • UPDATE
  • COMMIT
  • DUALSYNC

By using the flag "AutoSync" the synchronization window is hidden. If the sychroization is finished, the Function Call is exited.

importProject PathToProjectFile: String
Overwrite: Boolean
1.1.7

The function imports a project on an *. ftpproj file.

By using the flag "Overwrite" it can be determined, whether the project - if the project name already exists - will be overwritten automatically
.

exportProject ProjectName: String
PathToExportFile: String
Overwrite: Boolean
1.17

The function exports a project on an *. ftpproj file.

By using the flag "Overwrite" it can be determined, whether the export file should be overwritten - if it exists.

getLatestError

PathToTxtFile
Overwrite: Boolean

1.17

This function exports the last error message from FTPDirect Event Log into a *.txt file.

By using the flag "Overwrite" it can be determined, whether the export file should be overwritten - if it exists.

enableSSLForProject

ProjectName: String
PathToCrtFile: String

1.33 The function assigns a certificate to the project and activates SSL/TLS encryption.
disableSSLForProject ProjectName: String 1.33 The function unlinks all certificates from the project and deactivates SSL/TLS encryption.

 

4 Problems and return codes


Each function call has a return value. You can evaluate on the exit code of the FTPDirect.exe.

Below you will find a list of possible return codes:

Return code
Identifier
Description
0 RETCODE_OK The function has been executed successfully.
-1 RETCODE_FAILURE Function Call could not be parsed, syntax error.
20101 RETCODE_INVALID_FILE_PATH File path is invalid, e.g. at "importProject".
20102 RETCODE_INVALID_PROJECT The project could not be found, e.g. at "exportProject".
20103 RETCODE_INVALID_PROJECT_XML The *.ftpproj file contains errors/could not be parsed.
20104 RETCODE_PROJECT_EXISTS The project already exists. (For avoiding this error, simply set the Overwrite flag to TRUE.)
20105 RETCODE_INVALID_PARAM_COUNT The parameter count is invalid for current function.
20106 RETCODE_INVALID_EXPORT_PATH The export path already exists. (For avoiding this error, simply set the Overwrite flag to TRUE.)
20107 RETCODE_INVALID_FUNCTION The function does not exist.
20108 RETCODE_SYNCHRONIZING_FAILURE Could not initialize synchronization. (Use "getLatestError" for getting details).

 

5 Code snippets and examples

You might be wondering "What is a *. Ftpproj file?" or looking for complete examples. Then you will certainly find it here.

Beschreibung
Download URL
A *. zip archive which contains an *. ftpproj template file. (Automatic import of projects)
A collection of several *.bat scripts that call functions.
A CSharp project (Visual Studio 2008), which automatically performs a project import.

 

5.1 FTPDirect and CSharp

In the installation directory of "FTPDirect" you will find "FTPDirect.DataModel.dll". By linking this library into your CSharp project,

you have access to the class 'ProjectInfo'. This makes it very convenient possible to create the content of *. ftpproj files and to validate the entries directly. In the project "CSharp FunctionCall Example" and *.ftpproj file is imported and a synchronization is executed.

 

FTPDirect, Download bei heise   Get it from CNET Download.com!