ThingWorx Edge C SDK > How to Set Up an Application > Initializing the File Manager (Optional) > Create a File Transfer Event Handler (Optional)
Create a File Transfer Event Handler (Optional)
If you are using the File Transfer capability of the C SDK, you may want to create an event handler for any file transfer events. This handler is called when a new file is successfully sent from the platform to your application, and when an asynchronous file transfer from your device to the platform has completed either successfully or unsuccessfully.
The signature for a file transfer event callback is as follows:
typedef void (*file_cb) (char fileRcvd, twFileTransferInfo * info);
The input parameters for this callback function are as follows:
fileRcvd — a Boolean. true if the file was received, false if it was being sent
info — a pointer to the file transfer info structure. The called function retains ownership of this pointer and must delete it with twFileTransferInfo_Delete() when it has finished using it
The structure definition of twFileTransferInfo can be found in the file, src/fileTransfer/twFileManager.h.