Configure File Metadata¶
You can configure a file's metadata attributes to describe aspects of the file, such as its content type, language, or encoding. You can also use metadata attributes to configure the CDN's caching behavior and specify how clients should handle files when they access them.
If you do not specify a
Content-Type attribute for a file, MongoDB Realm
will attempt to automatically add a
Content-Type attribute to it
based on the file extension.
For example, Realm would automatically add the attribute
Content-Type: application/html to the file
Navigate to the File in the File Tree¶
To add a metadata attribute to a specific file you need to find the file in the hosted file tree. To find the file:
- Click Hosting in the left navigation menu.
- Select the Files tab.
- Find the entry for the file in the file tree.
Add a New Attribute¶
Once you have found the file, you need to add a new metadata attribute to it. To add a new metadata attribute:
- Click the file's Actions (...) button.
- Click Edit Attributes...
- In the Set Attributes modal, click Add Attribute.
Select the Attribute Type and Value¶
The new metadata attribute will not have a type or value when you first add it.
- Select the attribute type from new attribute's left-hand dropdown
- Enter a value for the attribute in the right-hand input box.
- Click Save.