Whenever i try to get the file, the length of the input stream (s.Length) is always zero, what am i doing wrong? ZipEntry is valid and has the proper size of the file, etc.
Here is the code im using:
public static byte[] GetFileFromZip(string zipPath, string fileName)
{
byte[] ret = null;
ZipFile zf = new ZipFile(zipPath);
ZipEntry ze = zf.GetEntry(fileName);
if (ze != null)
{
Stream s = zf.GetInputStream(ze);
ret = new byte[s.Length];
s.Read(ret, 0, ret.Length);
}
return ret;
}