local FTP = requrie "lluv.ftp"
local ftp = FTP.Connection.new(server, {uid = user, pwd = pass})
ftp:open(function(self, err)
-- Upload file data from string
ftp:stor('test.txt', 'hello world', function(self, err) ... end)
-- Download file with offset and get result as string
ftp:retr('test.txt', {type = "i", rest = 5}, function(self, err, code, data)
-- here data is array of file parts
data = table.concat(data)
end
-- Upload data from ltn12 source
ftp:stor('test.txt', {source = ltn12.source.string('hello world')}, function(self, err) ... end)
-- Download file to ltn12 sink
local t = {}
ftp:retr('test.txt', {sink = ltn12.sink.table(t)}, function(self, err, code, data)
local data = table.concat(t)
end
-
Notifications
You must be signed in to change notification settings - Fork 0
FTP client for lluv library
License
moteus/lua-lluv-ftp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
FTP client for lluv library
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published