Available for: Content Management Server
Task: Creates a new file with a draft version and loads the specified blob. The specified file in which the new file is to be created must be a folder.
Syntax:
obj (withId objId) | (withPath path) | root createAndLoad {parameter value}
Additional information:
- One of the parameters
blob, blob.plain, blob.base64,blob.streamorfilemust be specified. If more than one of these parameters is specified, it is undefined which one is evaluated. - The
contentTypeparameter (file name extension) must be set. - Specifying the file format is not necessary if a file name extension was
specified which is a
validContentTypein only one format, so that the format can be determined uniquely.
Function parameters:
-
parameteris the name of a parameter important for file creation. The value of this parameter is specified in the correspondingvalueparameter.parametercan be:-
blob,blob.plain,blob.base64orblob.streamspecifies thatvaluecontains the properly encoded version to import or, respectively, thatvaluecontains 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 file types other than image and resource). If not specified, the character set is taken from thecharsetuser preference. The Version Manager converts the blob to UTF-8. The list of the available character sets can be determined with the Tcl commandencoding names. -
contentType: The blob’s file name extension. -
file: The path of the correctly encoded file to import. The path can be composed of up to two components. It is relative to the user’s temporary directory and must not begin with the parent directory. This parameter is intended to be used by developers only. -
objClass: The name of the format to be assigned to the new file. -
name: The name the new file is to receive. A name is generated if none is specified. -
suppressExport: Specifies whether this file is to be exported.
-
-
valuecontains the value of the respective parameter.
Return value if successful: the ID of the new file (string)
Necessary permissions (CM only):
- The user must have the
permissionCreateChildrenpermission in the target folder. - The user must have the global file creation permission set in the format of the target file.
Example:
CM>obj root createAndLoad name news objClass newspub \ blob.base64 [encodeFile /opt/NPS/upload/newslist.html] news