public. Replace an existing attachment with a new version or create a new attachment
| Name | Type | Description |
| filename | string | "=" followed by a double uri-encoded file name |
| 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) |
| description | string? | file attachment description |
| redirects | int? | If zero, do not follow page redirects. |
| Name | Value | Description |
| BadRequest | 400 | Invalid input parameter or request body |
| Forbidden | 403 | Update access to the page is required |
| NotFound | 404 | Requested page could not be found |
| Ok | 200 | The request completed successfully |
Input:
File to upload
Output:
<file id="{int}" revision="{int}" href="{uri}">
<filename>{text}</filename>
<description>{text}</description>
<contents type="{mimetype}" size="{int}" width="{int}" height="{int}" href="{uri}" />
<contents.preview rel="thumb" type="{mimetype}" maxwidth="{int}" maxheight="{int}" href="{uri}" revision="{int}" />
<contents.preview rel="webview" type="{mimetype}" maxwidth="{int}" maxheight="{int}" href="{uri}" revision="{int}" />
<date.created>{date}</date.created>
<user.createdby id="{int}" href="{uri}">
<nick>{text}</nick>
<username>{text}</username>
<email>{text}</email>
</user.createdby>
<page.parent id="{int}" href="{uri}">
<title>{text}</title>
<path>{text}</path>
</page.parent>
</file>
File uploads to template pages are not allowed.
If a file with the same name already exists on the specified page, a new revision of the existing file is uploaded. Otherwise, a new file is created.
The contents.preview element only exists if a file preview is available. Preview generation requires the file to be an image and fall within a certain size.
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by