Move an attachment from one page to another and/or change the filename
Name | Type | Description |
fileid | int | identifies a file by ID |
Name | Type | Description |
authenticate | bool? | Force authentication for request (default: false) |
name | string? | new filename |
to | string? | page id of target page |
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 | Requested file could not be found |
A file cannot be moved to a template page or a destination page that already contains a file with the same name.
The following code example moves the file with ID 456 to the home page:
Plug p = Plug.New("http://deki-hayes/@api/deki"); p.At("users", "authenticate").WithCredentials("admin", "password").Get(); p.At("files", "456", "move").With("to", "home").Post();
The following command moves a file to a specified page. Both target file ID and destination page ID must be specified. In the following sample, a file with file ID "1" is moved to the page with page ID "2".
curl -u username:password -d "" -i http://mindtouch.address/@api/deki/files/1/move?to=2
An image of a popular meme needs to be moved to the Meme page (page ID = 68). The image has an ID value of 3.
curl -u username:password -d "" -i http://192.168.168.110/@api/deki/files/3/move?to=68
HTTP/1.1 200 OK Date: Mon, 11 Jan 2010 22:40:35 GMT Server: Dream-HTTPAPI/1.7.2.17433 X-Deki-Site: id="default" Content-Length: 0 Via: 1.1 dekiwiki Content-Type: text/plain