EMFileMessageBody

EMFileMessageBody

new EMFileMessageBody(localPath)

Source:
File message body constructor.
Parameters:
Name Type Description
localPath String The file path

Methods

displayName() → {String}

Source:
Get display name of the attachment.
Returns:
返回消息展示名
Type
String

downloadStatus() → {Number}

Source:
Get file downloading status
Returns:
下载状态
Type
Number

fileLength() → {Number}

Source:
Get file length of the attachment.
Returns:
返回文件大小
Type
Number

localPath() → {String}

Source:
Get local path of the attachment.
Returns:
返回附件本地存储路径
Type
String

remotePath() → {String}

Source:
Get remote path of the attachment.
Returns:
返回文件在服务器的存储位置
Type
String

secretKey() → {String}

Source:
Get secret key of the attachment, it's used to download attachment from server.
Returns:
返回文件加密密钥
Type
String

setDisplayName(displayName) → {void}

Source:
Set display name of the attachment.
Parameters:
Name Type Description
displayName String 消息展示名
Returns:
Type
void

setDownloadStatus(downloadStatus) → {void}

Source:
Set file downloading status. Note: Usually, user should NOT call this method directly.
Parameters:
Name Type Description
downloadStatus Number 设置下载状态
Returns:
Type
void

setFileLength(fileLength) → {void}

Source:
Set file length of the attachment. Note: It's usually not necessary to call this method, will calculate file length automatically when setting local path.
Parameters:
Name Type Description
fileLength Number 文件大小
Returns:
Type
void

setLocalPath(localPath) → {void}

Source:
Set local path of the attachment. Note: should NOT change the local path of the Received message.
Parameters:
Name Type Description
localPath String 附件本地存储路径
Returns:
Type
void

setRemotePath(remotePath) → {void}

Source:
Set remote path of the attachment. Note: It's internal used, user should never need to call this method.
Parameters:
Name Type Description
remotePath String 文件在服务器的存储位置
Returns:
Type
void

setSecretKey(secretKey) → {void}

Source:
Set secret key of the attachment. Note: It's internal used, user should never need to call this method.
Parameters:
Name Type Description
secretKey String 文件加密密钥
Returns:
Type
void

type() → {Number}

Source:
Get message body type.
Returns:
返回消息类型
Type
Number