How do I restrict file chooser?

0 favourites
  • 6 posts
From the Asset Store
Source File, music and art pack for Android Negotiator
  • Hi there, I'm trying to let user choose an image from their phone gallery and load it into a sprite by using file chooser. My problem while testing the app is, when I press the file chooser, it doesn't bring me to the phone's gallery, instead, it give me option to choose camera, gallery or file manager. How do I restrict the file chooser to select images from gallery only??

  • johnkx

    Are you wrapping with NW.js or how are you opening the filechooser?

    I think since you aren't directly programming in Apple's native programming language, but in html, you can't prevent that from happening.

    The user has to press gallery, that's one touch more. If you just explain what he has to do, it'll be fine.

  • randomly sorry for late reply! Was very busy recently.. Yes, I'm wrapping with NW.js. I have two buttons on my app, one is CAMERA (letting user to take a photo) and GALLERY (letting user to choose an image from their phone). To do that, I used File Chooser to let user have access to their phone's images. The problem is, when user choose GALLERY, android give user alot of options, option such as file manager and gallery is acceptable, but it also let user to choose camera, cam recorder, sound recorder, choose music track which is irrelevant.

    Is there anyway to not show so many options?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Did you try to restrict the file chooser to .jpg ?

    (Via the "Show open dialog" and then adding ".jpg" to the restricted file extensions)

    I don't know any more solutions, you would probably have to ask a developer.

    It might be also possible (as I already mentioned) that you simply can't not show the other options since your app is (though it is wrapped in NW.js) still coded for browsers and is, therefore, restricted to browser's controls.

    Those may not include the possibility to open the gallery directly.

  • I tried restrict the file chooser at File Chooser Properties/Accept/.jpeg, .png, but it din't work. This following question might be silly, but where to find "Show open dialog"..?

  • Take a look at this to see how to get to that option.

    http://i.imgur.com/jMdEqqL.png

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)