Attachment
Last updated
Last updated
An attachment field is a type of field that allows you to attach one or more files directly to a record within your data model.
In this article we are going to cover:
Adding an attachment field
Uploading attachments
Downloading attachments
Renaming attachments
Removing attachments
Using attachments
To add an attachment field that is to the right of the existing fields. Give a name to your field and select the attachment type.
Once you've created an attachments field, you can start uploading attachments into it.
To upload an attachment you must (A) click on the cell, (B) press the "+" button, (C) select the file that you wish to upload and (D) press "open" to upload the attachment.
Ditto Tip: note, we allow you to upload any type of attachment (JPG, PNG, WAV etc.) with no limits on the maximum size of a file that you wish to upload. Please note however that your workspace has a maximum amount of storage associated with it. You can increase this by choosing a different workspace plan.
You can download images either by clicking on the individual cell and pressing the download button:
Or by expanding the entire record and clicking the download button next to each image.
To rename an attachment, open the image or collection of images in an expanded view. Next, click the pencil icon to the right hand side of the download button.
To remove an attachment, you need to (A) open the attachment in an expanded view, (B) click the delete button below each attachment and (C) press save.
When using the attachments field in your app, there a few technical considerations to be aware of.
First, the attachments are stored as arrays of text values that point to the location of the file in your apps docker container. The reason for this is that you can have multiple attachments in each record.
As an example, take a look at the response from a GET endpoint where the returned record contains multiple attachments.
As you can see, the Property Images field (of type attachment) contains a structure that includes details such as id, URL, filename, width, height etc. If you're looking to display the image in the frontend of your app, you would need to specify which image you want to display from the list of returned images.