Data type MediahelperFile
Description:
Whenever you want to use media in TYRIOS, you need to upload the media into the media system. This has several reasons:
- Media in the media system is automatically analyzed and optimized. That means especially for images and videos, that the files are automatically optimized in dimensions, size and quality.
- Media is automatically sanitized. This does not only includes mime and content analysis, but also an automatic virus check.
Media in the media system is managed as MediahelperFile object. This page describes the general structure of this object.
Attention
Please be aware: TYRIOS is an aspect-oriented system and the concrete data structure depends on your system configuration. Especially in case you want to update existing data, please be aware to take all available fields into account or use an update specific API endpoint to avoid data loss.
General data structure
In general, a MediahelperFile object has the following data structure:
{
"id": 120, // automatically assigned ID
"fileName": "coupon.jpg", //basename of the file
"mediaType": "1", // media type, automatically identified on upload, 1=image, 2=video, 3=sound, 4=document, 5=zip, 6=directory
"detailFormat": "JPEG", // in case of images, the detail format of the image: JPEG, PNG, GIF or SVG
"filePath": "/directory/", // relative path to the MEDIA main system
"alternativeText": null, // default alternative text
"fileDescription": null, // a file description for the data,
"uploadTime": 1487531110, // unix timestamp when the file was uplaoded
"MediahelperFileDescendant": null, // potential reference to automatically generated derived files
"parentID": 1, // ID of parent MediahelperFile
"UserData": 1, // ID of the user who has uploaded this file
"securityLevel": "1", // security level, 1=public, 2=shareable by fileHash, 3=private
"fileHash": null, // file hash for security level and 3, automatically generated
"diskFileHash": "f6d725052b81cc737af2e06c2e53fa897233e765", // sha1 hash for the file, used to identify identical files, automatically generated
"version": 7, // version of the data object, automatically generated
"width": 1200, // in case of images: width of the file, automatically generated
"height": 392, // in case of images: height of the file, automatically generated
"source": null, // text field to describe where the media comes from
"licence": null, // text field to describe the licence of the media
"copyrightInformation": null // text file to save copyright information
}
Typically, in your instance, there are in addition many references to ensure that a media cannot be deleted while in use. Depending on the API, these references can be loaded and provided. In addition, the system typically provides preview and download URLs automatically via JSON.