content contentRef load

Available for: Content Management Server

Task: Loads the blob specified in the parameters into the version.

Additional information:

  • One of the parameters blob, blob.plain, blob.base64, or blob.stream must be specified.

Syntax:

content withId contentId load {contentAttr value}

Function parameters:

  • contentAttr refers to a parameter necessary for loading the blob. The following names are allowed here:
    • blob, blob.plain, blob.base64, or blob.stream specifies that value contains the properly encoded version to import or, respectively, that value contains a streaming ticket under which the version to import was uploaded. If several of these parameters are specified, it is undefined which one is evaluated.
    • charset: the character set of the blob (for files that are no images). If not specified, the character set is taken from the charset user preference. The default of this value is iso8859-1. The Content Manager converts the blob to UTF-8. The list of the available character sets can be determined using the Tcl command encoding names.
    • contentType specifies that value refers to the file name extension.
  • value specifies the value of the respective parameter.

Return value if successful: none

Necessary permissions: The user must have the permissionWrite permission for the file to which the version belongs. She must be the editor of the file.

Example: Load a file as the main content of a version:

CM>content withId 25687 load blob [loadFile \
/Users/NPS/Upload/news.html] contentType html

Example for a corresponding obj command:

CM>obj withId 242235 editedContent load blob [loadFile \
/Users/NPS/Upload/news.html] contentType html