Attachment

View as Markdown

An object with the URL and filesize (in bytes) of the given file.

Attachment dimensions (in px) are sometimes available for image and video attachments and are used to set the size of the thumbnail before loading, to prevent content shift when loading media on slower connections.

Example

1{
2 url: "https://firebasestorage.googleapis.com/v0/b/glaring-fire-2362/o/user_files%2Ft8Serdim%2F22503512b64d4439847c4b3b2f5a9cf6%2Fwatch-this.gif?alt=media&token=4418bd87-f2f1-4bbf-89d3-71be1b5c2772",
3 size: 3374800,
4 dimensions: {
5 height: 336,
6 width: 498,
7 }
8}

Properties

FieldTypeDescription
urlstringThe url to the uploaded file.
sizenumberThe size of the file in bytes.
dimensions (optional)AttachmentDimensionsExtra metadata for image, video and audio files.

Type Definitions

AttachmentDimensions

Properties

FieldTypeDescription
width (optional)numberThe width of the image or video in pixels, if known.
height (optional)numberThe height of the image or video in pixels, if known.
duration (optional)numberThe duration of the video or audio in seconds, if known.

Used by