ThingWorx Edge C SDK > Steps for Setting Up Applications > 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 will be called whenever a new file is successfully sent from the server to your application, and when an asynchronous file transfer from your device to the service 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 is 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
Return:
None
The structure definition of twFileTransferInfo can be found in the file src/fileTransfer/twFileManager.h.