Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET unzip with subfolders

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #20268 |


    let say that i have 4 folders under root directory c: as follows


    if i ask to zip folder_3 with its files and subfolders, the zipping i working fine, but when i unzipping the file it creates the all path incuding folder_1 and folder_2 which it not needed. what i need to do so the unzipping will create the folders without them.



    Imported from legacy forums. Posted by dvir (had 870 views)

    Xceed Support
    Post count: 5658


    Instead of copying the folder (by using the CopyTo() method), you can use the CopyFilesTo() method and it will copy the content of the folder instead of copying the folder itself.

    Code Sample:
    AbstractFolder source = new DiskFolder( @”FULLPATH\Test1″ );
    AbstractFile zipFile = new DiskFile( @”PathToArchive\Test1.zip” );

    ZipArchive archive = new ZipArchive( zipFile );

    source.CopyFilesTo( archive, true, true, null );



    Xceed Technical Support

    Imported from legacy forums. Posted by Alain [Xceed] (had 1485 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.