Archiver working example

padvou

Active Member
Licensed User
Longtime User
Dear all,
could somebody please give me a working example of this:

arc.ZipFiles((File.DirRootExternal & "/FrameOrders/", MysendDate & MysendTime & "os1.dat", File.DirRootExternal & "/FrameOrders/", MysendDate & MysendTime & "order.zip","OrderZip")

or this:

arc.AsyncZipFiles(File.DirRootExternal & "/FrameOrders/", MysendDate & MysendTime & "os2.dat", File.DirRootExternal & "/FrameOrders/", MysendDate & MysendTime & "order.zip","OrderZip")

What if i wanted to add multiple files?
Thank you
 

NJDude

Expert
Licensed User
Longtime User
Try this:
B4X:
Dim Zip As Archiver
Dim toZip() As String 'This array will contain all the files you want to zip

toZip = Array As String("File1.txt", "File2.txt", "File3.txt")

Zip.AsyncZipFiles(File.DirDefaultExternal & "/SomeDirectory/", toZip, File.DirDefaultExternal, "MyZipFile.zip", "Zip")
Then somewhere in your code:
B4X:
Sub Zip_ZipDone(Success As Boolean, FilesInZip As Int)

    ToastMessageShow(Success & "  " & FilesInZip, False)

End Sub
 
Last edited:
Upvote 0
Top