Hi,
we have requirement to generate zip file from list of images and allow it to download in Silverlight.
All images are stored on remote machine(\\192.168.1.7\\abc\\\abc\year\month\1234\1234.jpg).
so I have implemented functionality to get the list of images and passed it to wcf service as an argument
and it returns list of byte array.
I have implemented the below code to create the zip file from list of stream.
In above code I have used to deflate compression to compress stream but it always returns the size and compression not works.
Is there any more configuration required for compression to work?
Thanks
Rahul
we have requirement to generate zip file from list of images and allow it to download in Silverlight.
All images are stored on remote machine(\\192.168.1.7\\abc\\\abc\year\month\1234\1234.jpg).
so I have implemented functionality to get the list of images and passed it to wcf service as an argument
and it returns list of byte array.
I have implemented the below code to create the zip file from list of stream.
busyIndicator.IsBusy =
true
;
if
(ListPic.Count > 0)
{
//Save zip File
SaveFileDialog dialog =
new
SaveFileDialog();
dialog.Filter =
"Zip File | *.zip"
;
bool
? dialogResult = dialog.ShowDialog();
if
(dialogResult ==
true
)
{
using
(ZipPackage zipPackage = ZipPackage.Create(dialog.OpenFile()))
{
foreach
(PictureFile pic
in
ListPic)
{
Stream picStream =
new
MemoryStream(pic.PictureStream);
zipPackage.AddStream(picStream, System.IO.Path.GetFileName(pic.PictureName),ZipCompression.Deflated,DateTime.Now);
}
}
}
busyIndicator.IsBusy =
false
;
this
.DialogResult =
false
;
}
else
{
busyIndicator.IsBusy =
false
;
this
.DialogResult =
false
;
}
In above code I have used to deflate compression to compress stream but it always returns the size and compression not works.
Is there any more configuration required for compression to work?
Thanks
Rahul