GetFile

This function retrieves a file attached to a wiki.

This function is different from other functions in the API. The file content is returned in the body as you'd expect from a regular GET request, but with the metadata returned in an "X-JSON" header.

Request Parameters

file Required
The name of the file you would like to retrieve.

metaOnly Optional
If this is set, only the metadata is retrieved - the JSON/XML/PHP response object is returned as normal in the response body. Otherwise, the metadata is only in an X-JSON header (even if you requested XML or PHP return data).

Responses

The response will indicate the success or failure of the page creation; if successful, the file will be returned with an HTTP response code 200. You can fetch the metadata (size and upload time) either from the HTTP headers or from the X-JSON header.

Example

REQUEST

RESPONSE

X-JSON: {"v1":{"name":"test.txt","mtime":1155327429,"size":35,"type":"text/plain"}}
Content-Type: text/plain
Content-Length: 35
Last-Modified: Fri, 11 Aug 2006 20:17:09 +0000

The content of the returned file starts here.


Page Information

  • 1 year ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts