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

NameTypeRequiredDescription
fileBinarybinaryNoBinary data of the file (instead of filePath)
filePathstringNo (default="")Path to local file (instead of fileBinary)
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
ignoreAuditbooleanNo (default=false)
fileSizenumericNo (default=0)Size, in bytes, of the file