Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Unable to unzip a zipped file… Why?

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

    Why am I unable to unzip the zipped file? Well, the script ran fine and there was no exception error of any sort. So, when the script is done, I see no files in the sTmpDirPath directory… Why? What can you do to make it work?

    –snip–
    sTmpDirPath = “C:\folder1”;

    //License for the use of the Xceed’s components…
    Xceed.Zip.Licenser.LicenseKey = “####-####-####-####”;

    //Initialize variables…
    string sZipFilePath = sTmpDirPath + “\\” + “test.zip”;
    Xceed.FileSystem.DiskFile oDiskFile = new Xceed.FileSystem.DiskFile(sZipFileName);
    Xceed.Zip.ZipArchive oZipArchive = new Xceed.Zip.ZipArchive(oDiskFile);
    Xceed.FileSystem.DiskFolder oDiskFolder = new Xceed.FileSystem.DiskFolder(sTmpDirPath);

    //#oZipArchive.DefaultEncryptionMethod = Xceed.Zip.EncryptionMethod.WinZipAes
    //#oZipArchive.DefaultEncryptionStrength = 256
    //#oZipArchive.DefaultEncryptionPassword = “*****”

    //Unzip
    oZipArchive.CopyFilesTo(oDiskFolder, true, true);
    –snip–

    Thanks..

    Imported from legacy forums. Posted by fletchsod (had 2755 views)

    Xceed Support
    Member
    Post count: 5658

    I ran the code you sent and it worked fine.
    The only modification I did was to change sZipFileName to sZipFilePath in the following line:

    Xceed.FileSystem.DiskFile oDiskFile = new Xceed.FileSystem.DiskFile(sZipFileName);

    Imported from legacy forums. Posted by CharlesB (had 218 views)

    User (Old forums)
    Member
    Post count: 23064

    Ah! That’s what the problem is. It’s my first time writing the script that deal with extracting the zip file as I had never done it before. Took me a while to find an example code, so I thought I did something wrong.

    I did a file search on my machine and it could not find the file. I wonder why it didn’t raise the exception error if you use a filename without a full file path. This is with the latest Xceed version I downloaded today.

    Imported from legacy forums. Posted by fletchsod (had 3772 views)

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