473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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


Expand|Select|Wrap|Line Numbers
  1. ZipEntry entry = new ZipEntry(fi.Name);
  2.                         DateTime date = fi.LastWriteTime;
  3.  
  4.  
  5.                                     FileStream sReader = File.OpenRead(fName);
  6.                                     byte[] buff = new byte[Convert.ToInt64(sReader.Length)];
  7.                                     sReader.Read(buff, 0, (int)sReader.Length);
  8.                                     entry.DateTime = fi.LastWriteTime;
  9.                                     entry.Size = sReader.Length;
  10.                                     sReader.Close();
  11.                                     ZipOutputStream zipOut = new ZipOutputStream(File.Create(sPath + fi.Name + ".zip"));
  12.                                     zipOut.PutNextEntry(entry);
  13.                                     zipOut.Write(buff, 0, buff.Length);
  14.                                     zipOut.Finish();
  15.                                     zipOut.Close();
  16.                                     IsZip = true;
Oct 27 '10 #1
0 1088

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Thomas W | last post by:
I need to download all files older than 3 hours from a ftp-server. What's the easiest way to this? I've looked into the standard ftplib, but it seems like the only way to go is to parse the...
6
by: shailesh kumar | last post by:
Hi, I need to design data interfaces for accessing files of very large sizes efficiently. The data will be accessed in chunks of fixed size ... My data interface should be able to do a random...
2
by: grimBeast | last post by:
Hi I have a problem with the uploading of files larger than 1MB. My upload code look like this: If Not fUpload.PostedFile Is Nothing And fUpload.PostedFile.ContentLength > 0 Then fn =...
1
by: Jorge Ribeiro | last post by:
Hello I've an ASP.NET Web application that has one form where the user can upload a file to be sent and saved on a database. The app sends the file via DIME attachments and SOAP envelopes to a...
2
by: James | last post by:
i m looking for suggestions in this news groups what is the best way to delete files greater than x days. scenario / conditions a) d:\dir\queue\*.* files to be deleted. b) no-touch solutions ...
2
by: express99 | last post by:
i am new to perl scripting. i want to be able to delete folders and files older than n days recursively in a windows environment.
3
by: jaeden99 | last post by:
I was wandering if nyone has a script to move files older than x days old? i've seen several to delete, but I don't want to delete. I would like to create a backup of the files first verify with...
1
by: PanchalRakesh | last post by:
Dear All I am Making an application in which i want to create resume for a person usign web application and now i want to print that resume in A4 size pages using client print But i am not...
6
by: empiresolutions | last post by:
Using the following code, files greater than 10Megs do not download. Less than 10 is working. Can anyone explain why? Files that will be downloaded are 5G plus in size. function download() {...
19
by: Robert Kochem | last post by:
Hi, I am relative new to C++ regarding it's functions and libraries. I need to access files larger than 4GB which is AFAIK not possible with the STL iostream - at least not if using a 32 bit...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.