Hi,
I've made an app that download some zip-files and then list them so I could chose wich to open. The downloading and listning works fine but when I try to unzip a file I get the output "Failed to locate the zip header" in my catch. Does someone know what might cause this?
I'm using System.IO.Compression for the zip-part and had to manually install the System.IO.Compression.Filesystem to be able to use "ZipFile".
For file handling I use "PCLStorage"
async void Clicked_Open(object sender, System.EventArgs e)
{
IFile clickedFile = myList.SelectedItem as IFile;
await DisplayAlert("Alert", clickedFile.Path, "OK");
UnzipFiles(clickedFile, rootFolder.Path);
}
private async void UnzipFiles(IFile theZip, string theFolder)
{
try
{
ZipFile.ExtractToDirectory(theZip.Path, theFolder);
}
catch (Exception e)
{
await DisplayAlert("Alert", "error:" + e.Message, "OK");
}
}