Home > Developer

Storage API : SetItemInfo

SetItemInfo

Script path: /storage/bin/api/set_item_info.cgi

Description: Set item info for a file or folder, subject to access control.  The optional parameters and their value determine which item info you want to set.

INPUT (via GET or POST)

Mandatory parameters are: sid, path
Optional parameters are: description, lock, date, dategmt, mtime

sid session id of the login user. [mandatory]
path path to an item [mandatory]

Please refer to [How to specify a path].

path must point to an existing file or folder.

e.g.
path=/Private/MyFile.avi  - setting information for the file MyFile.avi in "Private" area
path=/Company Share/Archive/Data/ - setting information for the folder Data.

description = <a_descriptive_string>
This is optional, the existing item description will be unchanged if this parameter is unspecified.
To assign an empty string (clear the description) use "description=", that is specify description with an empty string. Currently the length of the description is limited to 80 characters. (Another limitation is that it cannot contain "::" <back-to-back-colon> in the string. Such patterns will be removed.
lock = yes | no
Set the lock status of the item to either lock (yes) or unlock (no).
This parameter is optional, existing lock status will be unchanged if unspecified. Lock status will also be unchanged if it is not "yes" or "no".
( This parameter is now deprecated. An alternative API to effect a Lock will be provided later.)
date = <14-digit string for user's localtime>
e.g. 20040324115809   for 24-Mar-2004 11:58:09am (+0800)
Sets the last-modification time of the item -- subject to access control.
dategmt = <14-digit string for GMT time>
e.g. 20040324035809   for 24-Mar-2004 03:58:09am (+0000)
Sets the last-modification time of the item -- subject to access control.
mtime
= epoch (the number of non-leap seconds since 1 Jan 1970 GMT)
mtime is in GMT. 
Sets the last-modification time of the item -- subject to access control.
ucarA valid JSON object representing the new UCAR settings for the item (which is applicable only to folders in Company Share and Company HomePage.)
Please refer to the documentation for GetItemInfo for the format of the JSON object for this parameter. The value for "item_info" -> "ucar" represents the same UCAR JSON object required here. If the JSON object has syntax error, it will flagged as an error.


Warning: For each call, use one of date, dategmt, mtime in exclusion of the other two.  Result of using more than one of them together in one go is not predictable.


OUTPUT (content-type: text/plain)

Successful return:

true <newline>


Unsuccessful return:

false <tab> <error message> <newline>

e.g.

false <TAB> New name is invalid. (illegal character, too long, etc.)