[Up]: Storage API : Rename
Script path: /storage/bin/api/rename.cgi
Description: Renames a file or folder.
INPUT (via GET or POST)
Mandatory parameters are: sid, path, newname
Optional parameters are: ofmt
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. |
newname | = <newname> The new name to use. For acceptable names, refer to [Name restriction] |
ofmt |
= null | json | jsonp null is the default, and the legacy "flat" output format is returned. json means the output format is in JSON format jsonp is like json, but in "pretty" form for easier human readability. |
OUTPUT (content-type: text/plain)
Successful return:
true <newline>
Equivalent JSON output would look like the following:
{
"status" : true
}
Unsuccessful return:
false <tab> <error message> <newline>
e.g.
false <TAB> New name is invalid. (illegal character, too long, etc.)
Equivalent JSON output would look like the following:
{
"http_status" : "400 Unable to rename item",
"status" : false,
"errmsg" : "New name is invalid. (illegal character, too long, etc.)"
}