Managing Files

List files and folders

Listing files and folder can be done using the LS and LSTAT calls. These designed to mimic the the unix filesystem methods.

post
/file/lstat

https://fileio.couchdrop.io/file/lstat
Retrieve properties for a file or folder.
Request
Response
Request
Query Parameters
token
required
string
Authentication Token
Form Data Parameters
path
required
string
Target path of file or folder.
Response
200: OK
{
"lstat": {
"filename": "document1.txt",
"size:": 10234,
"modtime": 1578531065,
"is_dir": false
}
}

post
/file/ls

https://fileio.couchdrop.io/files/ls
List files and directories in a given path
Request
Response
Request
Query Parameters
token
required
string
Authentication Token
Form Data Parameters
path
required
string
Target Path
Response
200: OK
A list of objects describing files and folders
{
"ls":[
{
"filename": "document1.txt",
"size:": 10234,
"modtime": 1578531065,
"is_dir": false
},
{
"filename": "folder1",
"size:": 0,
"modtime": 0,
"is_dir": true
}
]
}
403: Forbidden
{"error": "you do not have the right permissions"}
500: Internal Server Error
{"error": "we encountered an error"}

Renaming a file

post
/file/rename

https://fileio.couchdrop.io/file/rename
Rename a file
Request
Response
Request
Query Parameters
token
required
string
Authentication Token
Form Data Parameters
path_to
required
string
Destination Path
path
required
string
Source Path
Response
200: OK
{
"rename": true
}

Removing a file

post
/file/remove

https://fileio.couchdrop.io/file/remove
Remove a file
Request
Response
Request
Query Parameters
token
required
string
Authentication token
Form Data Parameters
path
required
string
Filename
Response
200: OK
{
"remove": true
}

Creating a directory

post
/file/mkdir

https://fileio.couchdrop.io/file/mkdir
Create a new directory
Request
Response
Request
Query Parameters
token
required
string
Authentication token
Form Data Parameters
path
required
string
New directory path
Response
200: OK
‚Äč