# Send files in chat Users can transfer files in chat during the session. > Zoom deletes files sent via in-session chat when the session ends. Enable [send files via in-session chat](/docs/build/account/#in-session-advanced) in your Video SDK account portal settings and configure the following settings. - **Only allow specified file types** - Select to allow only specific file types and enter the file extensions in the text box, separated by commas. - **Maximum file size** - Select to limit the file size to 2048 MB. Check if the file transfer feature is enabled. ```swift let ret = ZMVideoSDK.shared().getSessionInfo().isFileTransferEnabled() ``` ```objectivec BOOL ret = [[[ZMVideoSDK sharedVideoSDK] getSessionInfo] isFileTransferEnabled]; ``` Get the list of allowed file types that you can transfer. ```swift let ret = ZMVideoSDK.shared().getSessionInfo().getTransferFileTypeWhiteList() ``` ```objectivec NSString *ret = [[[ZMVideoSDK sharedVideoSDK] getSessionInfo] getTransferFileTypeWhiteList]; ``` Get the maximum file size to transfer. ```swift let ret = ZMVideoSDK.shared().getSessionInfo().getMaxTransferFileSize() ``` ```objectivec unsigned long long ret = [[[ZMVideoSDK sharedVideoSDK] getSessionInfo] getMaxTransferFileSize]; ``` Send files to all users in the current session. ```swift let ret = ZMVideoSDK.shared().getSessionInfo().transferFile(filePath: String) ``` ```objectivec ZMVideoSDKErrors ret = [[[ZMVideoSDK sharedVideoSDK] getSessionInfo] transferFile:self.filePathTextF.stringValue]; ``` Send files to a certain user in the session. ```swift // Locate the user that you would like to send the file to. let receiver: ZMVideoSDKUser // Send file directly. let ret = receiver.transferFile(filePath: String) ``` ```objectivec ZMVideoSDKErrors ret = [_receiverUser transferFile:self.filePathTextF.stringValue]; ``` Cancel sending files. ```swift // getCurrentSendFileObj is a user-defined method, to retrieve the sending file. let sendFile: ZMVideoSDKSendFile = getCurrentSendFileObj() let ret = sendFile.cancelSend() ``` ```objectivec ZMVideoSDKSendFile *send = [self getCurrentSendFileObj]; // getCurrentSendFileObj is a user-defined method, to retrieve the sending file. ZMVideoSDKErrors ret = [send cancelSend]; ``` Start receiving files. ```swift // getCurrentReceiveFileObj is a user-defined method, to retrieve the receiving file. let receiveFile: ZMVideoSDKReceiveFile = getCurrentReceiveFileObj() let fileDomain = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).map(\.path).last let filePath = "" let downloadFilePath = "\(fileDomain)/\(filePath.count > 0 ? filePath : receiveFile.fileName)" if (receiveFile) { let ret = receiveFile.startReceive(downloadFilePath) } ``` ```objectivec ZMVideoSDKReceiveFile *receive = [self getCurrentReceiveFileObj]; //getCurrentReceiveFileObj is a user-defined method, to retrieve the receiving file. NSString *fileDomain = [NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, YES).lastObject copy]; NSString *filePath = @""; NSString *downloadFilePath = [NSString stringWithFormat:@"%@/%@",fileDomain,filePath.length>0?filePath:receive.fileName]; if (receive) { ZMVideoSDKErrors ret = [receive startReceive:downloadFilePath]; } else { NSLog(@"receive is null"); } ``` Cancel receiving files. ```swift // getCurrentReceiveFileObj is a user-defined method, to retrieve the receiving file. let receiveFile: ZMVideoSDKReceiveFile = getCurrentReceiveFileObj() if (receiveFile) { let ret = receiveFile.cancelReceive() } ``` ```objectivec ZMVideoSDKReceiveFile *receive = [self getCurrentReceiveFileObj]; // getCurrentReceiveFileObj is a user-defined method, to retrieve the receiving file. if (receive) { ZMVideoSDKErrors ret = [receive cancelReceive]; } else { NSLog(@"receive is null"); } ``` ## File transfer callbacks Be sure that you have [set up a delegate for callback events](/docs/video-sdk/macos/integrate/#implement-a-delegate) to receive file transfer callbacks. Get notified when you transfer a file. ```swift func onSendFile(_ sendFile: ZMVideoSDKSendFile!, status: ZMVideoSDKFileTransferStatus) { // Get the transfer status of the file and the file content here. } ``` ```objectivec - (void)onSendFile:(ZMVideoSDKSendFile *)sendFile status:(ZMVideoSDKFileTransferStatus)status { // Get the transfer status of the file and the file content here. } ``` Get notified when you receive a file from other users. ```swift func onReceiveFile(_ receiveFile: ZMVideoSDKReceiveFile!, status: ZMVideoSDKFileTransferStatus) { // Get the transfer status of the file and the file content here. } ``` ```objectivec -(void)onReceiveFile:(ZMVideoSDKReceiveFile *)receiveFile status:(ZMVideoSDKFileTransferStatus)status { // Get the transfer status of the file and the file content here. } ```