addAsset()
Overview
public string function addAsset(
binary fileBinary
, string filePath = ""
, required string fileName
, required string folder
, struct assetData
, boolean ensureUniqueTitle = false
, boolean ignoreAudit = false
, numeric fileSize = 0
)
Adds an asset into the Asset manager. The asset binary will be uploaded to the appropriate storage location for the given folder.
Arguments
Name | Type | Required | Description |
---|---|---|---|
fileBinary | binary | No | Binary data of the file (instead of filePath) |
filePath | string | No (default="") | Path to local file (instead of fileBinary) |
fileName | string | Yes | Uploaded filename (asset type information will be retrieved from here) |
folder | string | Yes | Either folder ID or name of a configured system folder |
assetData | struct | No | Structure of additional data that can be saved against the Asset record |
ensureUniqueTitle | boolean | No (default=false) | If set to true (default is false), asset titles will be made unique should name conflicts exist |
ignoreAudit | boolean | No (default=false) | |
fileSize | numeric | No (default=0) | Size, in bytes, of the file |