My code:
request.BeginGetResponse(result =>
{
var response = request.EndGetResponse(result)
as
HttpWebResponse;
try
{
// StreamResourceInfo info = new StreamResourceInfo(response.GetResponseStream(), null);
//StreamResourceInfo zip = Application.GetResourceStream(info, new Uri("datos", UriKind.RelativeOrAbsolute));
Stream info = response.GetResponseStream();
if
(ZipPackage.IsZipFile(info))
{
using
(ZipPackage zipPackage = ZipPackage.Open(info, FileAccess.Read))
{
ZipPackageEntry zip = zipPackage.ZipPackageEntries[0];
using
(Stream responseStream = zip.OpenInputStream())
{
using
(StreamReader reader =
new
StreamReader(responseStream))
{
string
texto = reader.ReadToEnd();
lista = JsonConvert.DeserializeObject<List<Reportes>>(texto);
dis.BeginInvoke(
new
AddtoLista(LlenarLista), lista);
reader.Close();
responseStream.Close();
}
}
}
}
}
catch
(Exception ex)
{
throw
ex;
}
},
null
);
Thank you very much in advance
9 Answers, 1 is accepted
Could you please elaborate a bit more on this issue and tell us what compression tool is used to create the zip file or could you send us the file that is causing the problems?
Greetings,
Viktor Tsvetkov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Code in the Handler
public
void
ProcessRequest(HttpContext context)
{
string
texto =
new
StreamReader(context.Request.InputStream).ReadToEnd();
ParametrosReportes paramJSON = Newtonsoft.Json.JsonConvert.DeserializeObject<ParametrosReportes>(texto);
string
dataJSON =
string
.Empty;
if
(paramJSON !=
null
)
dataJSON =Newtonsoft.Json.JsonConvert.SerializeObject(ReportesMetodos.ObtenerReporte(conexion, paramJSON));
else
dataJSON = Newtonsoft.Json.JsonConvert.SerializeObject(ReportesMetodos.ObtenerReporte(conexion,
new
ParametrosReportes() { OrdendelReporte = OrdenarPor.Fecha, FechaInicial = DateTime.Now.ToString(
"dd/MM/yyyy"
), FechaFinal = DateTime.Now.ToString(
"dd/MM/yyyy"
), Tabla=
"0"
}));
string
archiveName = String.Format(
"archive-{0}.zip"
, DateTime.Now.ToString(
"yyyy-MMM-dd-HHmmss"
));
context.Response.ContentType =
"application/zip"
;
context.Response.AddHeader(
"content-disposition"
,
"filename="
+ archiveName);
using
(Ionic.Zip.ZipFile zip =
new
Ionic.Zip.ZipFile())
{
zip.AddEntry(
"datos"
, dataJSON);
zip.Save(context.Response.OutputStream);
}
}
ZipPackage works only with standard zip files and does not support other similar formats such as gzip, zip2, tar or rar. You can simply use the ZipPackage not only for the decompression, but also for the compression. If you have further questions feel free to ask.
Greetings,
Viktor Tsvetkov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Please accept my apologies for the misleading, I didn't notice that it is an ASP.NET application. Actually I tried to reproduce your issue, created a zip file using the Ionic.Zip library and added a string entry to it. Then I opened it with the ZipPackage and had no problem while reading the entry. So I am not sure what exactly causes the problem in your application. Could you please try some different scenario using the Ionic.Zip and the ZipPackage or try to simplify your project and send it to us, so we will be able to better investigate the problem?
Kind regards,
Viktor Tsvetkov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

You can download it from this URL: File to Download
Could you please examine the modified project and tell me if it works for you?
All the best,
Viktor Tsvetkov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

But looking closely I saw some changes to it and I am working, I assume that the project that I lack the time to open the solution you sent me the same dll Telerik.Windows.Zip
Thank you very much for your attention.
Accept my apologies, this project shouldn't be included, but instead you should add your Telerik.Windows.Zip.dll.
Greetings,
Viktor Tsvetkov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!