Adds RESTful HTTP wrapper to FTP
Based on ftpfs and rest-fs (currently via forks)
Docker: rest-ftp
docker pull hasnat/rest-ftp
docker-compose upENV Variables:
FTP_USER: admin -- default blank
FTP_PASS: admin -- default blank
FTP_HOST: ftp-server -- default 127.0.0.1
FTP_PORT: 21 -- default 21
FTP_SECURE: false -- default false
list contents of directory
optional
?recursive = list recursively default false
returns: list of full file or folder paths (trailing slash tells if dir)
res.body = [ { "fullDirPath" }, ... ]
?stats = Return file stats for the directory instead of file listing.
res.body = {
dev: 16777220,
mode: 16877,
nlink: 31,
uid: 501,
gid: 20,
rdev: 0,
blksize: 4096,
ino: 604862,
size: 1054,
blocks: 0,
atime: Thu Mar 05 2015 11:38:47 GMT-0800 (PST),
mtime: Thu Mar 05 2015 10:52:41 GMT-0800 (PST),
ctime: Thu Mar 05 2015 10:52:41 GMT-0800 (PST)
}
returns contents of file
if dir, redirect to dir path
optional
?encoding = default utf8
returns: res.body = { "file content" }
?stats = Return file stats for the file instead of file's contents.
res.body = {
dev: 16777220,
mode: 16877,
nlink: 31,
uid: 501,
gid: 20,
rdev: 0,
blksize: 4096,
ino: 604862,
size: 1054,
blocks: 0,
atime: Thu Mar 05 2015 11:38:47 GMT-0800 (PST),
mtime: Thu Mar 05 2015 10:52:41 GMT-0800 (PST),
ctime: Thu Mar 05 2015 10:52:41 GMT-0800 (PST)
}
creates or overwrites file
creates dir if it does not exist.
renames or moves file if newPath exists
optional
body.newpath = if exist, move/rename file to this location.
body.clobber = if true will overwrite dest files (default false)
body.mkdirp = if true will create path to new location (default false)
body.mode = permissions of file (defaults: file 438(0666) dir 511(0777))
body.encoding = default utf8
optional for stream
query.clobber = overwrite if exist
query.mode = permissions of file (defaults: file 438(0666) dir 511(0777))
query.encoding = default utf8
returns: modified resource. (trailing slash tells if dir)
req.body = { "fullFileOrDirPath" }
creates file
optional
body.mode = permissions of file (438 default 0666 octal)
body.encoding = default utf8
returns: modified resource (trailing slash tells if dir)
req.body = { "fullFilePath" }
deletes folder
if file returns error
returns:
req.body = {}
deletes file
if folder returns error
returns:
req.body = {}
Content type
Image
Digest
Size
333.5 MB
Last updated
almost 5 years ago
docker pull hasnat/rest-ftp