[Up]: Storage API : DropItem Reject

DropItem Reject

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

Description: Facilitate dropfile or dropfolder rejection (or dismissal). (i.e. remove the dropitem record from the database register)

INPUT (via GET or POST)

   sid => the authenticated session id  (must be valid)

id => the dropitem id (alphanumeric)

This id identifies the specific dropfile or dropfolder from which it will be taken as the source
to copy from.

MULTIPLE ids can be specified by concatenating the individual ids together with '//' seperating them.
e.g. <id1>//<id2>//<id3>
or iDvvhfTK4DbaJAO8476ELR7YB//UnxfZAvucygODwBfm1joI04Df//o7FEw3sCfy65FDx1oP98Jknmd

ofmt => output format defaults to JSON format with minimal white spaces.
ofmt = jsonp means to produce JSON format in pretty printed way (easier to read)

OUTPUT (content-type: text/plain)


   JSON output object for general successful case, where each dropfile id gets processed.
However, the result_list needs to be inspected to see if processing result for EACH id.
result = "OK" | "FAIL" (for successful processing or not)

{
"status" : true,
"result_list" : [
{
"itemname" : "SomeFile.txt",
"id" : "iDvvhfTK4DbaJAO8476ELR7YB",
"comments" : "",
"isfolder" : 0,
"result" : "OK" // important to inspect this result for this id
},
{
"itemname" : "AnyFile.txt",
"id" : "UnxfZAvucygODwBfm1joI04DfX",
"comments" : "Fail to deregister drop file/folder.",
"isfolder" : 0,
"result" : "FAIL" // if failed, only the id and comments are meaningful.
},
{
"itemname" : null,
"id" : "2MPVSR2FL59Til1fnZXISxKE90",
"comments" : "Dropfile ID does not exist anymore or is not valid.",
"isfolder" : 0,
"result" : "OK" // Note it is "OK", with a comment, IF id is not valid or non-existent
}

]
}


JSON output object for general unsuccessful case:

{
"status" : false,
"errmsg" : "(reason for failure)"
}

e.g.
{
"status" : false,
"errmsg" : "Fail to connect to database."
}

In all cases, appropriate HTTP header status codes are also returned e.g. 200 OK, 401 Invalid user
profile, etc.