How do I restrict file chooser?

Get help using Construct 2

Post » Mon Oct 10, 2016 6:41 am

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??
B
48
S
20
G
6
Posts: 73
Reputation: 6,474

Post » Mon Oct 10, 2016 12:28 pm

@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.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Wed Oct 12, 2016 6:51 am

@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?
B
48
S
20
G
6
Posts: 73
Reputation: 6,474

Post » Wed Oct 12, 2016 7:52 pm

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.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Thu Oct 13, 2016 2:57 am

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"..?
B
48
S
20
G
6
Posts: 73
Reputation: 6,474

Post » Thu Oct 13, 2016 7:13 pm

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

http://i.imgur.com/jMdEqqL.png
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests