Unzip files

Hello,

After a few researches i found this to zip files :https://help.syncfusion.com/aspnetmvc-classic/xlsio/faq/how-to-zip-files-by-using-the-syncfusion-compression-zip-namespace

But I couldn't find any documentation to unzip files. I use a method to get a byte[] from my database when I clic on a cell from my grid. Now then I have to unzip it in order to return a byte[] of the file (mostly PDF or DOCX) inside.

Could you show me a documentation or sample in order to do that ?

Regards,
David.

5 Replies

AV Abirami Varadharajan Syncfusion Team April 12, 2018 08:46 PM UTC

Hi David, 
 
Thank you for contacting Syncfusion support. 
 
We have prepared simple sample to unzip the file as stream and the sample can be downloaded from following link. 
 
 
Please refer to below documentation to know more about compressing and uncompressing using Syncfusion Compression 
 
 
Regards, 
Abirami. 



DC David Caraiannis April 23, 2018 09:50 AM UTC

Hi,

Thank you for your answer.

Unfortunately, it doesn't completly close my issue. Your samples work for files that are located on the computer and that we know of. I am only working with an array of bytes whether it is to upload or download.

So that means I don't have a path and the file is only known as a byte[].

Today I directly download the zipfile as base64 with a link "a" in javascript (called from a link in the grid) :

data = "data:application/zip;base64," + binary;
var a = window.document.createElement("a");
a.rel='nofollow' href = data;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);

But I would like to unzip (with C# or Javascript) the file from my variable byte[]  and return the result (still as a byte[]) to download the file inside with my javascript.

To be very brief :
The user click on the link -> app gets the file as an array of byte from oracle server -> unzip -> return the unzipped file inside as an array of byte -> JS download 

Regards,
David.


AV Abirami Varadharajan Syncfusion Team April 24, 2018 05:46 PM UTC

Hi David, 

We have prepared sample as per your requirement and the sample can be downloaded from following link. 

  
Kindly try this and let us know if this helps at your end. 

Regards, 
Abirami 



DC David Caraiannis April 26, 2018 02:21 PM UTC

Hi,

It worked. Thank you for your help.

Regards,
David.


AV Abirami Varadharajan Syncfusion Team April 27, 2018 07:20 AM UTC

Hi David, 

Thank you for updating us. 

We are glad that your requirement is fulfilled. Please let us know if you need further assistance. 

Regards, 
Abirami. 


Loader.
Up arrow icon