Search All Forums
Dart Home | PowerTCP Zip Compression for .NET | Custom Development Reply | PowerTCP Zip Compression for .NET Topics | Forums   
AuthorForum: PowerTCP Zip Compression for .NET
Topic: Unable to compress folder

From: Montreal, QC Canada
Posts: 1
Member Since: 03/13/08
posted July 29, 2008 10:31 AM

How to compress foler whith ArchiveItem class.
I'm using C# and I always get "The specified name contains invalid characters or is too long." exception.

I can compress a file by this way:
item = new ArchiveItem( "c:\\temp\\file.txt" );
I can compress folder with quickzip like this:
archive.QuickZip("c:\\temp", "c:\\t.zip");

But this line of code give me an exception:
item = new ArchiveItem( "c:\\temp" );

Jason Farrar (Admin)

From: USA
Posts: 223
Member Since: 07/24/07

Extra Support Options
Custom Application Development

posted July 29, 2008 11:48 AM

You can't. The documentation for the control explicitly states that the ArchiveItem Constructor overload that takes a string is for specifying a filename, not a folder name. This is because an ArchiveItem is the representation of a single Item within a zip file, whereas a folder could contain any possible number of files within a Zip file. To add a directory you should use the overload of the Add method on the Archive object that takes a string to specify folders.

-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.

Reply | PowerTCP Zip Compression for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX