3.3 KiB
3.3 KiB
Filesystem Methods
POST/filesystem/{path}
Description
Creates a new directory or uploads a file to an existing directory.
<h3>Parameters</h3>
<p>
The form parameters <b>must</b> be sent in the order displayed below
for the realtime error checking to work. If 'name' comes after
'file' it will be ignored.
</p>
<table>
<tr>
<td>Param</td>
<td>Location</td>
<td>Description</td>
</tr>
<tr>
<td>type</td>
<td>Form Values</td>
<td>The type of node to create, can either be 'directory', or 'file'</td>
</tr>
<tr>
<td>name</td>
<td>Form Values</td>
<td>
Name of the directory to create, or of file to create. Not
required if 'type' is 'file'
</td>
</tr>
<tr>
<td>file</td>
<td>Form Values</td>
<td>
Multipart file to upload to the directory. Will be ignored
if 'type' is 'directory'
</td>
</tr>
</table>
<h3>Returns</h3>
HTTP 200: OK { "success": true, "id": "abc123" // ID of the newly uploaded file }
todo
</div>
GET/filesystem/{path}
Description
Returns information about the requested path.
Parameters
Param | Required | Location | Description |
path | true | URL | Path to the directory or file to request |
download | false | URL | If the URL paramater '?download' is passed the requested file will be downloaded (if it is a file) |
Returns
When the requested entity is a directory:
HTTP 200: OK { "success": true, "name": "some dir", "path": "/some dir", "type": "directory", "child_directories": [ { "name": "some other directory", "type": "directory", "path": "/some dir/some other directory" } ], "child_files": [ { "name": "11. Lenny Kravitz - Fly away.ogg", "type": "file", "path": "/some dir/11. Lenny Kravitz - Fly away.ogg" } ] }
When the requested entity is a file:
HTTP 200: OK { "success": true, "name": "11. Lenny Kravitz - Fly away.ogg", "path": "/some dir/11. Lenny Kravitz - Fly away.ogg", "type": "file", "file_info": { "success": true, "id": "Jf_u5TI9", "name": "11. Lenny Kravitz - Fly away.ogg", "date_upload": "2018-07-04T22:24:48Z", "date_last_view": "2018-07-04T22:24:48Z", "size": 9757269, "views": 0, "mime_type": "application/ogg", "thumbnail_href": "/file/Jf_u5TI9/thumbnail" } }
DELETE/filesystem/{path}
Description
Deletes a filesystem node.
Parameters
Param | Required | Location | Description |
path | true | URL | Path of the entity to delete |
Returns
HTTP 200: OK { "success": true }