Hi,
I’ve seen that the ZIP Plugin api states that this is the way to compress the files into zip archive:
local options = { zipFile = "mytest.zip", zipBaseDir = system.DocumentsDirectory, srcBaseDir = system.DocumentsDirectory, srcFiles = { "space.jpg", "space1.jpg", "space2.jpg"}, listener = zipListener } zip.compress(options);
However, this API can’t help if I have entire folder that I want to zip recursively.
For example I may be having following file/folder structure:
my_files/
folder_1/
file_1a.txt
file_1b.txt
folder_2/
file_2a.txt
folder_3/
folder_33/
file_33a.txt
Now I already know it’s not *unfortunately* possible to do this:
srcFiles={ "my\_files" }
and let the zip compress all the files recursively.
However, even if I manually list all the files in these folders
srcFiles = { "my\_files/folder\_1/file\_1a.txt", "my\_files/folder\_1/file\_2a.txt", ... etc }
the resulting zip archive will contain all the files I’ve listed, BUT their folder structure will not be preserved - ie. everything will be packed in such way that it’s unpacked to root folder (in this case will be mytest/ folder after unpacking the files).
So is there a way to compress the files in order to preserve the folder structure?
Thanks
N.