Today share the next thing I did yesterday ASP. net file Zip bulk download, first you need to go to http://dotnetzip.codeplex.com This site to download the ZIP package, found inside the Ionic.Zip.dll reference to your project /// <summary> ///Bulk Zip Download/// </summary> /// <param name= "listimg" >here listimg is an array type</param> Public voidCreatezip (stringlistimg) { string[] IMGs = Listimg.split (','); HttpContext.Current.Response.Clear (); HttpContext.Current.Response.BufferOutput=false; //Web site file generates a Readme.txt Readme file (can not be written)String Readmetext = String.Format ("README. TXT"+environment.newline+"Site Address: http://aicoffees.com" ); HttpContext.Current.Response.ContentType="Application/zip";//output in zip formatHttpContext.Current.Response.AddHeader ("content-disposition","inline; filename=\ "Photo.zip");//compress the downloaded name//Bulk Compression Operations using(ZipFile zip =NewZipFile ()) { for(inti =0; I < IMGs. Length; i++) {///Add the above Readme file within the package, the text encoding is the system default encoding formzip. AddEntry ("Readme.txt", Readmetext, Encoding.default); Zip. Password="aicoffees.com";//to set a password for a compressed packageZip. encryption = encryptionalgorithm.winzipaes256;//Encryption Methodzip. AddFile (HttpContext.Current.Server.MapPath (imgs[i). ToString ()),"");//here "" I give is empty is compressed when not set folder, if need to take what name only need in "" Inside add on can, here is an overloaded method, ifzip. AddFile (HttpContext.Current.Server.MapPath (imgs[i). ToString ()),""In this case, zip will by default compress your image from the root directory to the directory where your files are located. } zip. Save (HttpContext.Current.Response.OutputStream); } HttpContext.Current.Response.Close (); The above is a little summary of their own, come on
ASP. Itext Operation PDF