API Questions on Kentico API.
Version 5.x > API > Usin CMS.ZipProvider View modes: 
User avatar
Guest
ko - 2/4/2012 8:03:23 AM
   
Usin CMS.ZipProvider
I was hoping to find someone who's had some success in using this class, particularly the extractall method. I'm trying to setup a scheduled task where I am ftping in a bunch of zip files. Once in, I need to unzip those files and then process their contents.

I have no problem getting the files in but I can't seem to get the zip part working.. I was originally using a shared piece called SharpZip I believe but that kept stalling at which point I found this innate class in the API and wanted to try it but I can't seem to get it to do what I need to do.

Can someone provide me with an example of how to use this class/method? Thank you!

User avatar
Member
Member
kentico_michal - 2/7/2012 1:49:37 AM
   
RE:Usin CMS.ZipProvider
Hello,

Please take a look at the following code snippet that demonstrates how you can uncompress a zip file:


ZipProvider zipProvider = ZipProvider.Read(zipFile);
zipProvider.ExtractAll(targetFolder);
zipProvider.Dispose();

If you need more information, I would recommend you to take a look at the API reference: Kentico CMS API.

Best regards,
Michal Legen