RESTLog File API
The RESTLog File API is an HTTP interface for uploading and managing files, whether they are photographs, icons, Word Documents, HTML pages, etc.
N.B. This interface was originally called the RESTLog Image API but as was pointed out on [ucapi-discuss] this could be extended by accepting more media types, without coming close to the capabilities of WebDAV. Providing a limited interface makes the RESTLog File API operate like a WebDAV-lite.
URL | Verb | Type | Description | Format |
---|---|---|---|---|
/.../albumID | GET | html | An HTML page for all the documents in this album. Includes thumbnails. | |
xml | A list of al the documents and sub-albums. Notes. | Archive | ||
POST | xml | Create a new sub-album. | <album> <name>albumID</name> </album> | |
DELETE | - | Delete the album. | ||
/.../docID | GET | varies | The document | What ever is stored there, PNG, GIF, Word Document, PDF, etc. |
PUT | varies | Creates or overwrite a document. | What ever is used, PNG, GIF, etc. | |
DELETE | - | Delete the document. |
Note 1: Note that this specification is recursive. That is it defines the operations available on an album, which include the creation of sub-albums. The sub-albums must then support this API.
Note 2: I have intentionally used the term 'album' instead of directory throughout this specification to avoid confusing implementation and specification. When implementing the specification the albums could be implemented as sub-directories. On the otherhand an implementation could store all the files in an SQL database.
Note 3: In the Archive format documents appear in 'res' elements while sub-albums appear as 'more' elements.
Examples to go here.