Filename$ = OpenFileRequester(Pattern$, Callback [, Flags])
Opens the standard requester for the user to choose one or several local files. For security reason, the requester can be opened only from an event callback triggered by a real user action (ie: when the user click on a gadget). This commands needs to be put in an event procedure, like in the example below. The selected file is get with NextSelectedFile() and SelectedFileName() in the callback.


Pattern$ A standard filter which allow to display only the files which end with such or such extension. It has to be in the MIME form : "image/*", "audio/*" etc. A list of most common MIME types can be found here: http:://
Callback The callback to be called if the user has selected one or several file. It won't be called if the user canceled the requester. It has to use the following syntax:
  Procedure Callback()
    ; Code here
Flags (optional) It can be a combination of one of the following values:
  #PB_Requester_MultiSelection: Enable the multiselection (see NextSelectedFile()).
  #PB_Requester_GoogleDrive: Uses the Google file requester to select a file. UseGoogleDrive() has to be
                             successfully initialized before using this requester. Note: to be able to open
                             the requester, a domain name needs to be used (ip address won't work), and this domain
                             needs to be allowed in the google developper console. For testing purpose,
                             you can modify your /etc/hosts file and put a domain alias for, and
                             then set the 'web server address' compiler option of the SpiderBasic IDE.

Return value



  Procedure RequesterSuccess()
    ; Process all the selected filename
    While NextSelectedFile()
      Debug "Filename: " + SelectedFileName()
  Procedure ButtonEvent()
    OpenFileRequester("", @RequesterSuccess(), #PB_Requester_MultiSelection)
  If OpenWindow(0, 100, 100, 200, 55, "File")
    ButtonGadget(0, 10, 10, 170, 25, "Open local file...")
    BindGadgetEvent(0, @ButtonEvent())

See Also


Supported OS


<- NextSelectedFile() - Requester Index - SelectedFileID() ->