Parameters
required
Attachment object
Returns
Promise<number>
File size in bytes, or 0 if file doesn’t existDocumentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
getAttachmentSize(attachment: Attachment): Promise<number>
import { getAttachmentSize } from '@photon-ai/imessage-kit/helpers'
const size = await getAttachmentSize(attachment)
console.log(`File size: ${(size / 1024 / 1024).toFixed(2)} MB`)
Promise<number>
File size in bytes, or 0 if file doesn’t existWas this page helpful?