[Up]: Storage API : Delete
Script path: /storage/bin/api/delete.cgi
Description: Deletes a file or folder (and all its content).
INPUT (via GET or POST)
Mandatory parameters are: sid, path
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. Specify each of the multiple path parameter in full path format. e.g. path=/Private/File.txt&path=/Company+Share/Video.avi |
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
}
NOTE: If an item does not exist, the API returns successful, as if it existed and got deleted!
Unsuccessful return:
false <tab> <error message> <newline>
e.g.
false <TAB> Access denied. (Or item may be locked)
false <TAB> Unable to delete an item within.
This last message means that while deleting an entire
folder, one or more file or subfolder within could not be deleted.
This cause the
folder to remain in existence.
Equivalent JSON output would look like the following:
{
"http_status" : "400 Unable to delete item",
"status" : false,
"errmsg" : "Access denied. (Or item may be locked)"
}
{
"http_status" : "400 Unable to delete item",
"status" : false,
"errmsg" : "Unable to delete an item within."
}