Home > Developer
Developer Reference

   Home : Developer Reference

Storage API : Delete

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: none

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  - delete the file MyFile.avi in "Private" area
path=/Company Share/Archive/Data/ - delete folder Data and all its content.

Multiple path paramters can be specified to delete multiple items in one go. (Be careful!). Internally the items are deleted one at a time and if an error is encountered while deleting an item, the process will abort leaving the remaining items not deleted. Only upon successfully deleting ALL items, then there will be a successful response. So, in case of error during multiple deletions, some item may have already been deleted.

Specify each of the multiple path parameter in full path format. e.g.  path=/Private/File.txt&path=/Company+Share/Video.avi

OUTPUT (content-type: text/plain)

Successful return:

true <newline>

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.