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 Name | Field Type | Description |
---|---|---|
file_uri | string | A unique identifier for the file, typically a URI string that includes the file name and extension. |
upload_link | string | File link |
folder | string | Folder where uploaded links are stored, all links from OpenAPI uploads will be under url_upload |
size | integer | File size |
type | string | The MIME type of the file, such as image/jpeg, image/png, or application/pdf. |
origin_link | string | The original URL of the file, if applicable. |
desc | string | A brief description of the file |
aspect_ratio | string | Aspect ratio |
width | integer | Image width in pixels |
height | integer | Image height in pixels |
created_at | string | The ISO 8601 timestamp indicating when the file was created |
updated_at | string | The 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
Feature | Metafield | Material File | Image |
---|---|---|---|
Supported Content Types | Text, numbers, colors, file links, dates, images, etc. | Images only | Images only |
Flexibility | High, suitable for extending fields and dynamic binding | Moderate, designed for managing image libraries | Low, used for direct image display |
Adaptation Scope | Product details pages, collection details pages, dynamic field configurations | Material library management and reusable images | Product images, front-end theme image display |
Use Case | Dynamic field configuration, complex content display | Managing and reusing image assets | Simple 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.