Use space.sendFile() to send files. Pass a local path the sending line can read, or raw bytes in data. Set name so the recipient sees a sensible filename.
// From a file path (dedicated / self-hosted lines)
await space.sendFile({
  path: "/path/to/photo.jpg",
  name: "photo.jpg",
});

// From a buffer
await space.sendFile({
  data: buffer,
  name: "report.pdf",
});

Options

FieldDescription
pathFilesystem path the line can read
dataRaw bytes (Uint8Array or ArrayBuffer)
nameDisplay filename
stickerSend as a sticker (iMessage)
audioSend as a voice memo — see Voice

Inbound attachments

Inbound attachment metadata arrives on message.content. Fetch bytes through your line’s attachment APIs when you need the file body — webhook deliveries include metadata only.

Platform support

PlatformsendFile
iMessage (cloud / dedicated)
Terminal
WhatsApp BusinessUse wa.image / wa.document with a hosted link or media id