1. Tim Ford
  2. PowerBuilder
  3. Monday, 18 September 2023 21:18 PM UTC

Short of writing a custom interface, can anyone suggest an alternative to the PB standard functions GetFileOpenName() and GetFileSaveName()? We are wanting to let users select a file for open or save, but restrict their ability to change the folder by entering a UNC path (potentially gaining access to areas they shouldn't). Navigating down the folder structure is fine, we just don't want them to have the ability to navigate up or outside of the starting (initial) folder. We also want to lock down the right-click functionality exposed by GetFileOpenName() and GetFileSaveName() for similar security reasons. Any recommendations would be appreciated!

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Monday, 18 September 2023 23:04 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Tim - 

If you're concerned with keeping users out of folders/drive/servers, then I believe this should be addressed via NTFS permissions and/or group policies, not by restricting access via the application. What's to prevent a user from accessing files at a verboten location via Windows Explorer?

PB users a "common dialog" version of the GetOpenFileName/GetSaveFileName interfaces, and the functionality you're requesting is not implemented by these dialog windows according to the Windows documentation I've looked at.

That leaves you with the option of rolling your own. Instead of starting completely from scratch, I suggest you examine the "Filesys" free code sample app from Roland Smith's TopWizProgramming web site:

    https://www.topwizprogramming.com/freecode_filesys.html

Best regards, John

Comment
There are no comments made yet.
Tim Ford Accepted Answer Pending Moderation
  1. Wednesday, 20 December 2023 23:48 PM UTC
  2. PowerBuilder
  3. # 1

Thanks for the response and suggestions. I believe we will most likely be "rolling our own" and will definitely be looking at what Roland Smith has in his "Filesys" code examples.

Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Friday, 22 September 2023 13:36 PM UTC
  2. PowerBuilder
  3. # 2

Another option you could try is using a listbox and the DirList() function to populate it.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.