AddFile

This function adds a new file to the wiki, given the attached data. A future version may support "transloading" of content, whereby you can supply a URL for the data you'd like to upload. You must have write access to the wiki for this function to succeed and the file must not yet exist.

Request Parameters

file Required
Specifies what new file you'd like to create. If the file already exists, the function will fail. Since it is a GET parameter, it must be URI encoded.

POST data Required
The entire content of the POSTed data will be treated as the new file content. This data is not assumed to be escaped in any way and may contain Unicode. If the posted data is more than 5MB, the request will fail. For debugging purposes, you may provide a "data" parameter in the GET query string - this will override the POST body if given. This is not recommended for production use, however, as GET string length is quite limited.

Responses

The response will indicate the success or failure of the file's creation; if successful, a simple object will be returned with "uploaded" set to "w00t".

Example

REQUEST

RESPONSE

{ "v1": {
  "uploaded": "w00t"
}}


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