Update an existing attachment property
| Name | Type | Description |
| key | string | A unique identifier for a property that is obtained through GET:files/{fileid}/properties |
| fileid | int | identifies a file by ID |
| Name | Type | Description |
| description | string? | Description of property |
| etag | string? | Etag of the current version of the property. Can alternatively be provided via ETag header. |
| authenticate | bool? | Force authentication for request (default: false) |
| redirects | int? | If zero, do not follow page redirects. |
| abort | {never, modified, exists}? | Specifies condition under which to prevent the update; default is modified. |
| Name | Value | Description |
| OK | 200 | The request completed successfully |
| Bad Request | 400 | Invalid input parameter or request body |
| Forbidden | 403 | UPDATE access is required |
| Not Found | 404 | Requested file and/or property could not be found |
Response is the standard property XML
<property name="{text}" href="{uri}" etag="{text}">
<contents type="{text}" href="{uri}">{text}</contents>
<date.modified>{date}</date.modified>
<user.modified id="{int}" href="{uri}">
<nick>{text}</nick>
<username>{text}</username>
</user.modified>
<change-description>{text}</change-description>
</property>
The following command binds the data in file "ping" to property "foo" of attachment "bar" in page "pong".
curl -u username:password -H "Content-Type: text/plain" -H "Etag: xxx" -T ping -i http://mindtouch.address/@api/deki/pages/=pong/files/=bar/properties/foo
curl -u username:password -H "Content-Type: text/plain" -T ping -i http://mindtouch.address/@api/deki/pages/=pong/files/=bar/properties/foo?etag=xxx
An attachment has been deemed copyrighted, thus we want to change its property, "iscopyright", to yes. The file name is fu.jpg on page FUBAR.
Content-Type: text/plain
yes
curl -u admin:password -H "Content-Type: text/plain" -H "Etag: 106.r1_ts2010-01-21T19:50:41Z" -T attachprop.txt -i http://192.168.59.128/@api/deki/pages/=FUBAR/files/=fu.jpg/properties/iscopyright
HTTP/1.1 200 OK Date: Thu, 21 Jan 2010 19:54:52 GMT Server: Dream-HTTPAPI/2.0.0.17629 Microsoft-HTTPAPI/2.0 Content-Length: 675 Content-Type: application/xml; charset=utf-8 X-Data-Stats: request-time-ms=145; mysql-queries=13; mysql-time-ms=88; X-Deki-Site: id="default" Via: 1.1 dekiwiki
Content-Type: application/xml
<?xml version="1.0"?>
<property name="iscopyright" href="http://192.168.59.128/@api/deki/files/71/properties/iscopyright/info" etag="106.r2_ts2010-01-21T19:54:52Z">
<contents type="text/plain" size="3" href="http://192.168.59.128/@api/deki/files/71/properties/iscopyright">yes</contents>
<date.modified>2010-01-21T19:54:52Z</date.modified>
<user.modified id="1" href="http://192.168.59.128/@api/deki/users/1">
<nick>Admin</nick>
<username>Admin</username>
<email>admin@admin.com</email>
<hash.email>64e1b8d34f425d19e1ee2ea7236d3028</hash.email>
<uri.gravatar>http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028</uri.gravatar>
</user.modified>
<change-description/>
</property>