I am create a zip file in asp.net code using ICSharpCode.SharpZipLib.Zip ,
all thing is properly work but my problem is that when i unzip my file after download then this is use large folder's series like "c_\inetpub\wwwroot\applicationforlder\herezipfolder", if i was using two three folder for my requirments than this
is vary large for view the actual file after unzip it so i wnat that the zip contain only applicationfolder name instead of "c_\inetpub\wwwroot\applicationforlder" whole path,
if any body have any idia for remove this then help me.
DotNetZip does password-protected files, AES Encryption, ZIP64, Unicode filenames, Self-extracting archives, and more. It's fast and easy to use. Works on medium-trust sites.
In DotNetZip, the code to specify the folder structure in the ZIP file is like this:
Response.Clear();
Response.BufferOutput= false;
string fileName= String.Format("files-{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "inline; filename=\"" + archiveName + "\"");
using (var z = new ZipFile())
{
// add a bunch of files, "flattening" them into a single dir in the zip
z.AddFiles(listOfFiles, "files");
// save directly to output stream for download to browser
z.Save(Response.OutputStream);
}
Response.Close();
Member
22 Points
76 Posts
create zip file in asp.net
Jul 19, 2006 05:50 AM|hi_arv|LINK
hi to all,
I am create a zip file in asp.net code using ICSharpCode.SharpZipLib.Zip , all thing is properly work but my problem is that when i unzip my file after download then this is use large folder's series like "c_\inetpub\wwwroot\applicationforlder\herezipfolder", if i was using two three folder for my requirments than this is vary large for view the actual file after unzip it so i wnat that the zip contain only applicationfolder name instead of "c_\inetpub\wwwroot\applicationforlder" whole path,
if any body have any idia for remove this then help me.
arvind
None
0 Points
3 Posts
Re: create zip file in asp.net
Nov 21, 2007 10:40 PM|sijo_raj|LINK
Hi,
It is very simple.You can use this simple code to create a Zip file in ASP.NET with VB.
Imports System.Io
File.WriteAllBytes("c:\sijoraj.zip", emptyZip) 'Destination Zip File Name Here
oApp = CreateObject("Shell.Application")oApp.Namespace("c:\sijoraj.zip").CopyHere("c:\sijoraj.JPG") 'Source File Name
MsgBox("compressed")SIJO N RAJ
Member
100 Points
73 Posts
Re: create zip file in asp.net
Feb 12, 2009 02:26 AM|cheeso|LINK
That may work but not very dev-friendly or flexible.
If you want a flexible, easy-to-use, reliable ZIP library for use within ASP.NET, try DotNetZip.
http://www.codeplex.com/DotNetZip/Thread/View.aspx?ThreadId=46688
DotNetZip does password-protected files, AES Encryption, ZIP64, Unicode filenames, Self-extracting archives, and more. It's fast and easy to use. Works on medium-trust sites.
It's free, open-source, works with VB, C# and any .NET language. Download it at http://dotnetzip.codeplex.com
ZIP Zip file
Member
270 Points
645 Posts
Re: create zip file in asp.net
May 25, 2009 05:07 AM|AxleWack|LINK
have you gotten an answer to this problem ?
Member
100 Points
73 Posts
Re: create zip file in asp.net
May 29, 2009 09:30 AM|cheeso|LINK
In DotNetZip, the code to specify the folder structure in the ZIP file is like this:
DotNetZip is free to use. Just download and go. You can browse the class reference for DotNetZip here: http://cheeso.members.winisp.net/DotNetZipHelp/
Zip file
Member
60 Points
21 Posts
Re: create zip file in asp.net
Jun 01, 2010 05:09 PM|smhsimple|LINK
You can also use chilkat built-in component for this purpose, go through the following link and you find a way.
http://developersmania.blogspot.com/2010/06/creating-zip-file-using-cnet.html
http://developersmania.blogspot.com/
None
0 Points
4 Posts
Re: create zip file in asp.net
Mar 08, 2011 05:17 AM|malay01051986|LINK
dfcf
None
0 Points
4 Posts
Re: create zip file in asp.net
Mar 08, 2011 05:17 AM|malay01051986|LINK
dfcf
None
0 Points
4 Posts
Re: create zip file in asp.net
Mar 08, 2011 05:17 AM|malay01051986|LINK
gfvdfgdsfgdfgdf