Browse SDKs · uni-app / uni-app x
SDKsuni-app

Create a file message from a file

OpenIM uni-app / uni-app x SDK guide for Create a file message from a file.

Copy
import { createFileMessageFromFullPath } from '@/uni_modules/unix-openim-sdk'

const message = await createFileMessageFromFullPath({
  filePath: '/data/user/0/app/cache/report.pdf', fileName: 'report.pdf',
})

Commercial createFileMessage() can include source-path metadata. Validate path, permission, size, and extension. Treat fileName as display text, never as a path component.