{{define "api-directory-path-post"}}
POST/directory/{path}

Description

Creates a new directory or uploads a file to an existing directory.

Parameters

Param Location Description
type Form Values The type of node to create, can either be 'directory', or 'file'
name Form Values Name of the directory to create, or of file to create. Not required if 'type' is 'file'
file Form Values Multipart file to upload to the directory. Will be ignored if 'type' is 'directory'

Returns

HTTP 200: OK
{
	"success": true,
	"id": "abc123" // ID of the newly uploaded file
}
todo
{{end}} {{define "api-directory-path-get"}}
GET/directory/{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",
			"path": "/some dir/some other directory"
		}
	],
	"child_files": [
		{
			"name": "11. Lenny Kravitz - Fly away.ogg",
			"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",
		"file_name": "11. Lenny Kravitz - Fly away.ogg",
		"date_upload": "2018-07-04T22:24:48Z",
		"date_last_view": "2018-07-04T22:24:48Z",
		"file_size": 9757269,
		"views": 0,
		"mime_type": "application/ogg",
		"thumbnail_href": "/file/Jf_u5TI9/thumbnail"
	}
}
{{end}} {{define "api-directory-path-delete"}}
DELETE/directory/{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
}
{{end}}