All Collections
Automation
Functions
Function GetFileProperties()
Function GetFileProperties()

Returns details of the file stored in a Files record, like the file type, size, URL and image size

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a week ago

GetFileProperties(fileId) returns an object containing the properties of the file identified by fileId.

Use it to retrieve necessary properties, for example the file's URL for storing in your CRM. See Files in Mapsly for more details.

Input

fileId: ID of a file stored in a Files field of a Mapsly system object like Check In, or a Fiels field of a Form action.

Output

An object with the following fields:

  • name: file name

  • type: file type, one of the following:

    • image

    • document

  • size: file size, in bytes

  • content_type: file content type

  • file_url: file URL. To access this URL, a user must be logged in to Mapsly. If you need a temporary direct URL of a file, for example, to add an image to an HTML form field, use GetFileURL() instead.

  • owner_id: Mapsly user ID who uploaded the file

  • owner_name: Mapsly user name who uploaded the file

The follow additional fields are present in the returned object if the file type is image:

  • width: image width, in pixels

  • height: image height, in pixels

See also:

Did this answer your question?