IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMFileElemabstract
Swift - V2TIMFileElem
Swift

Class V2TIMFile​Elem

public class V2TIMFileElem : V2TIMElem  

Definition of V2TIMFileElem

V2TIMFileElem V2TIMFileElem V2TIMElem V2TIMElem V2TIMFileElem->V2TIMElem

Superclass

V2TIMElem

Definition of V2TIMElem

Initializers

init()

public override init()  

Properties

path

public var path: String?  

Path to the local file sent(valid only for the message sender)

uuid

public var uuid: String?  

File ID which is an internal ID and can be used as an external cache key

filename

public var filename: String?  

File name

file​Size

public var fileSize: Int  

File size

Methods

get​Url(callback:​)

public func getUrl(callback: @escaping (String?) -> (Void))  

Get the file download URL

download​File(path:​progress:​succ:​fail:​)

public func downloadFile(path: String, progress: V2TIMDownLoadProgress?, succ: V2TIMSucc?, fail: V2TIMFail?)  

Download a file

The downloadFile API downloads files from the server each time. If cache or storage is required, you can use UUIDs as keys for external storage. The IM SDK does not store resource files.

Parameters

path String

File save path, which must be specified externally