Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

C# Use Open File Dialog to explore contents of PDX (zip) file

We use an industry standard file (PDX) that is basically a zip archive file with the extension changed. I want to allow the user to first select a .pdx file and then allow them to select a file within the archive. I found this answer that shows a very clever way to achieve this using the OpenFileDialog. It works great if the archive has the .zip extension. The problem is when the extension of the archive file is changed to .pdx then the open file dialog will not show the contents of the .pdx file.

Is there a way to achieve this functionality with the OpenFileDialog? I do not want to create my own dialog if there is a simple solution.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Is it possible to copy the PDX file to a temporary folder? Then change the extension to name.pdx.zip, when the user clicks select file, and after that immediately open the zip in the temporary folder?

  1. user clicks open file (the .pdx file), (so the selection window closes)
  2. the program copies the PDX file to a temp folder
  3. change the extension of the new file to name.pdx.zip (inside the temporary folder).
  4. automatically open another file select window into the zip file

I hope I could help.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading