FVSDK_ERROR_CODE FVSDK_Upload(FVSDK_Session* pSession, LPCTSTR pszSourcePath, LPCTSTR pszDestPath);
Uploads one or more files to the connected server. If using wildcards, multiple files can be uploaded into a single directory (pszDestPath). Use this function when you want to upload a file or files with a single function call. Use FVSDK_CreateFile() to upload a single file in blocks, fully under your control.
When pSession->bConnectionSaver is TRUE (the default), this function waits (blocks) until the file transfer is complete. When pSession->bConnectionSaver is FALSE, this function returns prior to the transfer starting, making this function asynchronous (non-blocking).
pSession
A pointer to the FVSDK_Session that is to perform the operation.
pszSourcePath
The local path to a single file or the path to a directory with a wild carded name.
pszDestPath
The remote path to a single file or a path where wild carded files are to be uploaded. If specifying a directory name for the destination, be sure to end the string with a / character to signify a directory.
FVSDK_OK if successful; error codes can be found in FVSDK_ErrorCodes.h.
NOTE: If the session structure is valid, this function always returns FVSDK_OK. This is done because transfers can be asynchronous if bConnectionSaver is set to FALSE. To be notified of transfer errors, use the appropriate callback function found in the FVSDK_Session structure.
// turn off connection saver so the uploads are asynchronous (non-blocking)
pSession->bConnectionSaver = FALSE;
// apply the session changes
FVSDK_ApplySessionChange(pSession);
// NOTE: Because we turned connection saver off (above) the following functions will exit
// prior to completing the transfer
// upload the file to the server (notice that the remote file can be a different filename)
FVSDK_Upload(pSession, "D:\\Temp\\fvsetup.exe", "/pub/rhinosoft/ftpvoyager/ftpvoyager.exe");
// upload the file to the server
FVSDK_Upload(pSession, "D:\\Temp\\ftpvgerman.exe", "/pub/rhinosoft/ftpvoyager/");
// upload all text files in the local path to the server
FVSDK_Upload(pSession, "D:\\Temp\\*.txt", "/pub/rhinosoft/ftpvoyager/");