How to zip files with size more than 2 GB using .net and C#.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rupalik

    #1

    How to zip files with size more than 2 GB using .net and C#.

    I am using this code but it doen't zip files more than 2 GB


    Code:
    ZipEntry entry = new ZipEntry(fi.Name);
                            DateTime date = fi.LastWriteTime;
    
    
                                        FileStream sReader = File.OpenRead(fName);
                                        byte[] buff = new byte[Convert.ToInt64(sReader.Length)];
                                        sReader.Read(buff, 0, (int)sReader.Length);
                                        entry.DateTime = fi.LastWriteTime;
                                        entry.Size = sReader.Length;
                                        sReader.Close();
                                        ZipOutputStream zipOut = new ZipOutputStream(File.Create(sPath + fi.Name + ".zip"));
                                        zipOut.PutNextEntry(entry);
                                        zipOut.Write(buff, 0, buff.Length);
                                        zipOut.Finish();
                                        zipOut.Close();
                                        IsZip = true;
    Last edited by MMcCarthy; Oct 27 '10, 11:29 AM. Reason: added code tags
Working...