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

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

    hi

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

    c:\Folder_1\Folder_2\Folder_3\Folder_4

    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.

     

    regards

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

    Xceed Support
    Member
    Post count: 5658

    Hi,

    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 );

    Regards,

    Alain,

    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.