Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
How to Retrive the Selected Entries from the Zip.
posted

HI 

   I am creating the Zip file based on the Hierarchy.. So i am recrusively  go throught the enteries and get the selected path and add the FIle under the Folder. my issue is  how to retrive the selected path from the selectedEntries.

ZipEntry en = zip.SelectEntries(FileName).FirstOrDefault();

if the filename having space it is throwing argument null exception,

 pls see the attached sample project. like that  employee structureneed to create the folder,

can u update my project and send me.. 

thanks and regards

Kannan

Parents
No Data
Reply
  • 6759
    Offline posted

    Hi,

    I couldn't quite catch what exactly you are trying to achieve from the provided sample.  Here a few notes that might be of help:

    1. SelectEntry is not what you want: "This Method is intended for use with a ZipFile that has been Read from storage. When creating a new ZipFile, this Method will work only after the ZipArchive has been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip archive from storage.) Calling SelectEntries on a ZipFile that has not yet been saved will deliver undefined results. " - check out its help page
    2. ArgumentNullException is kind of expected because the string SelectCriteria has a specific format and in your case it is invalid - for more info click here
    3. So instead of
      ZipEntry en = zip.SelectEntries(FileName).FirstOrDefault();
      I suggest to use something like this:
      ZipEntry en = zip.Entries.FirstOrDefault(e => e.FileName == FileName);

     

    Regards

Children