Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have a byte[] from database which I need to convert into .zip file.

Please Help !!

Thanks, Tapas

"Happy Coding"
Posted

A byte array can be anything. How was it generated/what does it contain?
If it was generated from a zip stream or zip file, you just need to write it to disk with a BinaryWriter.
 
Share this answer
 
Try:
C#
File.WriteAllBytes(@"D:\Temp\Myfile.zip", dataBytesFromDB);
If the data is a zip file, this will recreate it. If it isn't, and what you are actually asking for is "how to I create a new zip file containing this array of bytes?" then look at this: http://stackoverflow.com/questions/17217077/create-zip-file-from-byte[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900