Error unzipping in WCF

3 posts, 1 answers
  1. Alexander Jimenez
    Alexander Jimenez avatar
    11 posts
    Member since:
    Sep 2009

    Posted 02 Sep 2012 Link to this post


    I'm trying to create a ZIP file from Silverlight with a list of JSON data and compresses well. The problem is to receive it in the server because I have no library Telerik receive the Zip to extract and process the result. The library I am using is IonicZip to receive the result but I get error trying to read the MemoryStream. Is there a library for Telerik decompress the ZIP file

    Code in Silverlight:
    MemoryStream memoryStream = new MemoryStream();
    ZipCompression method = ZipCompression.Default;
    Telerik.Windows.Zip.ZipOutputStream zipOutputStream = new Telerik.Windows.Zip.ZipOutputStream(memoryStream, method);
    StreamWriter writer = new StreamWriter(zipOutputStream);
    ServicesClient context = new ServicesClient();
    context.SetZipFileAsync( Convert.ToBase64String(memoryStream.ToArray()));
    Code in WCF:
    public void SetZipFile(string _parameter)
             if (!string.IsNullOrWhiteSpace(_parameter))
                 var info = Convert.FromBase64String(_parameter);
                 MemoryStream stream = new MemoryStream(info);
                 string dataList = string.Empty;
                 MemoryStream output = new MemoryStream();
                 StreamReader read = new StreamReader(output);
                 using (ZipFile zip = ZipFile.Read(stream))
                     ZipEntry item = zip[0];
                     output.Seek(0, SeekOrigin.Begin);
                     dataList = read.ReadToEnd();
  2. Answer
    Tina Stancheva
    Tina Stancheva avatar
    3298 posts

    Posted 05 Sep 2012 Link to this post

    Hi Alexander,

    In the RadControls for WPF suite of controls, you can get the Telerik.Windows.Zip.dll which is a plain .Net assembly and you can reference it in your WebApplication. Give this a try and let us know if you need more information.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Alexander Jimenez
    Alexander Jimenez avatar
    11 posts
    Member since:
    Sep 2009

    Posted 12 Sep 2012 Link to this post

    I served well, thank you very much. should include SeverControl DLL in a folder or something similar.

    Thank you again.
Back to Top