I’m storing some local database files in the Application.persistentDataPath folder. Now i’d like to compress these db’s to a zip file and mail them as an attachment.
I know there is are libraries available and i have tried ICSharpCode but there isn’t really an example on how to do this in Unity3D. Is there anyone who managed to get this working?
So i’m now using dotnetzip library for compressing files in the Application.persistentDataPath folder. On my Mac this works perfectly, but when i’m trying to compress the files on IOS the zip compression throws an exception:
My code:
function ZipFolder()
{
try
{
var zip : ZipFile = new ZipFile();
zip.AddDirectory(Application.persistentDataPath + "/DB");
zip.Save(Application.persistentDataPath + "/Test.zip");
}
catch(e)
{
errorLabel.text = e.ToString();
}
}
Edit:
Nvm figured it out. I needed to add some dll’s: