Delete file attachment
Name | Type | Description |
fileid | int | identifies a file by ID |
filename | string | Double uri-encoded file name. Should be prefixed with "=" if it does not have an extension. |
pageid | string | either an integer page ID, "home", or "=" followed by a double uri-encoded page title |
Name | Type | Description |
authenticate | bool? | Force authentication for request (default: false) |
redirects | int? | If zero, do not follow page redirects (only applies when {pageid} is present). |
Name | Value | Description |
OK | 200 | The request completed successfully |
Bad Request | 400 | Invalid input parameter or request body |
Forbidden | 403 | Update access to the page is required |
Not Found | 404 | The requested file could not be found |
None
When a file is deleted, it is moved into the archive. It will remain in the archive until it is either permanently deleted (archive/files/{fileid} (DELETE)) or restored (archive/files/restore/{fileid} (POST)).
Use files/{fileid} (GET) to retrieve a list of files across the site or pages/{pageid}/files (GET) to retrieve the files on a specified page.
The following code example deletes myfile.jpg from the home page:
Plug p = Plug.New("http://deki-hayes/@api/deki"); p.At("users", "authenticate").WithCredentials("admin", "password").Get(); p.At("pages", "home", "files", "=myfile%252ejpg").Delete();
Add notes about requirements or config values
The following command deletes file "foo" from page "bar". Note that the file is placed in the archive where it can either be restored or permanently deleted.
curl -u admin:password -X DELETE -i http://mindtouch.address/@api/deki/pages/=bar/files/=foo