This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Sending images package to app
#4
Use this example to extract files from zip and read them:
Code:
zip = '/home/ftp/files.zip' -- source zip archive

if not io.exists(zip) then
  alert('file not found')
  return
end

dir = '/tmp/zip'
os.execute('rm -rf ' .. dir) -- clean-up
os.execute('mkdir ' .. dir) -- create dir
os.execute('unzip -qq -j "' .. zip .. '" -d ' .. dir) -- unzip

files = io.ls(dir) -- list file
for _, file in ipairs(files) do
  data = io.readfile(dir .. '/' .. file)
  log(file, data)
end

os.execute('rm -rf ' .. dir) -- clean-up
Reply


Messages In This Thread
Sending images package to app - by buuuudzik - 08.06.2018, 05:30
RE: Sending images package to app - by admin - 15.06.2018, 08:11
RE: Sending images package to app - by admin - 01.04.2020, 11:23

Forum Jump: