addAsset()

Overview

public string function addAsset(
      required binary  fileBinary       
    , required string  fileName         
    , required string  folder           
    ,          struct  assetData        
    ,          boolean ensureUniqueTitle = false
)

Adds an asset into the Asset manager. The asset binary will be uploaded to the appropriate storage location for the given folder.

Arguments

NameTypeRequiredDescription
fileBinarybinaryYesBinary data of the file
fileNamestringYesUploaded filename (asset type information will be retrieved from here)
folderstringYesEither folder ID or name of a configured system folder
assetDatastructNoStructure of additional data that can be saved against the Asset record
ensureUniqueTitlebooleanNo (default=false)If set to true (default is false), asset titles will be made unique should name conflicts exist