This is a migrated thread and some comments may be shown as answers.

Zipping in a memory stream

5 Answers 253 Views
ZipLibrary
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 11 Dec 2012, 10:27 PM
I am trying to zip files to a memory stream but the stream content is always 0 even if the stream length seem correct.

MemoryStream ms = new MemoryStream();

            Telerik.Windows.Zip.ZipPackage z = null;

                    z = Telerik.Windows.Zip.ZipPackage.Create(ms);
                    z.Add(fi.FullName);

            Data = null;

            System.IO.BinaryReader reader = new System.IO.BinaryReader(ms);
            Data = new byte[(int)ms.Length];
            reader.Read(Data, 0, (int)ms.Length);            
            ms.Close();

--> Data contains only "0".

Can you pls advise ?

Thanks

Patrick

5 Answers, 1 is accepted

Sort by
0
Patrick
Top achievements
Rank 1
answered on 12 Dec 2012, 05:06 PM
ok solved the issue, I was reading the mem stream at the wrong location

Sorry for that
0
Raghavendra
Top achievements
Rank 1
answered on 09 Apr 2013, 02:05 PM
We are using the target framework as 4.5. Telerik.Windows.Zip dll is not compiling with our code as it used to. Is there a easy fix/solution? Why is this not upward compatible?
0
Tina Stancheva
Telerik team
answered on 12 Apr 2013, 07:33 AM
Hi Raghavendra,

I'm not sure where do you try to reference the Telerik.Windows.Zip.dll and why you can't compile the solution. As this forum thread is regarding the Silverlight version of the ZipLibrary, I'm not sure if you're trying to use the library in a Silverlight 5 application or not.

However, please note that if you need to use the library in a Web solution, you'll need to get the version of the Telerik.Windows.Zip.dll that is provided within the WPF 4.5 assemblies as this is the plain .Net version assembly that can be used within Web solutions.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Raghavendra
Top achievements
Rank 1
answered on 12 Apr 2013, 04:19 PM
If we use WPF 4.5 version for Telerik.Windows.Zip.dll to zip data on Web Service, can we unzip the data on our Silverlight 5 UI with silverlight version of Telerik.Windows.Zip.dll without any shortcomings/issues/errors?
0
Vladislav
Telerik team
answered on 17 Apr 2013, 11:39 AM
Hello Raghavendra,

It is absolutely valid scenario to use the Telerik.Windows.Zip.dll in the described way.
If you encounter any issue using the ZipLibrary in the described way, this will mean that there is a problem in the ZipLibrary itself, rather than of an inappropriate use of it.

Please let us know if you encounter any problem using it this way.

Kind regards,
Vladislav
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ZipLibrary
Asked by
Patrick
Top achievements
Rank 1
Answers by
Patrick
Top achievements
Rank 1
Raghavendra
Top achievements
Rank 1
Tina Stancheva
Telerik team
Vladislav
Telerik team
Share this question
or