Hello
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 ASP.net Telerik decompress the ZIP file
Code in Silverlight:Code in WCF: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);
writer.Write(listSave.ToJSON());
writer.Flush();
ServicesClient context =
new
ServicesClient();
context.SetZipFileAsync( Convert.ToBase64String(memoryStream.ToArray()));
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];
item.Extract(output);
output.Seek(0, SeekOrigin.Begin);
dataList = read.ReadToEnd();
}
}
}