1

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.

Terry
  • 11
  • 3

1 Answers1

0

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.

Barni
  • 16
  • 3
  • 1
    Thanks, that is a great idea! I can't believe I didn't think of it. Only two additional lines of code...one to copy the file and another to delete it after the dialog closes. Works great! – Terry Jan 07 '22 at 19:48