File Properties

This JSON structure represents the metadata and properties of a file, typically used in file management systems. Below is an overview of each property included in the file object:

File properties

Field NameField TypeDescription
file_uristringA unique identifier for the file, typically a URI string that includes the file name and extension.
upload_linkstringFile link
folderstringFolder where uploaded links are stored, all links from OpenAPI uploads will be under url_upload
sizeintegerFile size
typestringThe MIME type of the file, such as image/jpeg, image/png, or application/pdf.
origin_linkstringThe original URL of the file, if applicable.
descstringA brief description of the file
aspect_ratiostringAspect ratio
widthintegerImage width in pixels
heightintegerImage height in pixels
created_atstringThe ISO 8601 timestamp indicating when the file was created
updated_atstringThe ISO 8601 timestamp indicating the last time the file was modified

Example

{
  "upload_link": "https://cdn.shoplazza.com/652c51e6ea5273f8e0b5c3a30b62fd57.jpeg",
  "file_uri": "652c51e6ea5273f8e0b5c3a30b62fd57.jpeg",
  "folder": "url_upload",
  "size": 0,
  "type": "image/jpeg",
  "origin_link": "",
  "desc": "",
  "aspect_ratio": "1.5032680",
  "width": 690,
  "height": 459,
  "created_at": "2024-04-23T09:25:54+08:00",
  "updated_at": "2024-04-24T16:14:03+08:00"
}

Comparison of Metafield, Material File, and Image

FeatureMetafieldMaterial FileImage
Supported Content TypesText, numbers, colors, file links, dates, images, etc.Images onlyImages only
FlexibilityHigh, suitable for extending fields and dynamic bindingModerate, designed for managing image librariesLow, used for direct image display
Adaptation ScopeProduct details pages, collection details pages, dynamic field configurationsMaterial library management and reusable imagesProduct images, front-end theme image display
Use CaseDynamic field configuration, complex content displayManaging and reusing image assetsSimple product or theme image display

Key Notes

  • Metafield:

    • Ideal for cases requiring dynamic binding, custom fields, or displaying diverse content types.
    • Example: Adding material descriptions, usage instructions, or supplementary visuals to product or collection details pages.
  • Material File:

    • Specifically for image resource management, allowing centralized image uploads and reuse across various parts of the store.
    • Example: Managing banners, logos, or reusable images in the admin.
  • Image:

    • Best suited for directly displaying product or theme images without dynamic or complex content binding.
    • Example: Displaying product pictures or static images in themes.