# Trouble with FileChooser on iOS

**URL:** <https://forum.juce.com/t/trouble-with-filechooser-on-ios/30721>\
**Category:** MacOSX and iOS\
**Created:** [December 5, 2018, 7:33pm UTC](https://forum.juce.com/t/trouble-with-filechooser-on-ios/30721 "2018-12-05T19:33:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkv](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rkv](https://forum.juce.com/u/rkv)\
**Post date:** [December 5, 2018, 7:33pm UTC](https://forum.juce.com/t/trouble-with-filechooser-on-ios/30721/1 "2018-12-05T19:33:45Z")

</div>

Hello,

for days now I am trying to get the FileChooser working in my iOS app.  
I am already able to save a file either on my iPad or in my iCloud via FileChooser. That’s working fine so far.  
But I can’t get it to work when I want to load this file. Neither from iPad disk nor from iCloud. Here we have the first strange issue:  
When I store the file on my iCloud it appears greyed in the FileChooser for loading it. I can even not pick it. Yet, I can access the fiel via my Mac.  
When I store it directly on my iPad it is not greyed and I can pick it.

Second issue:  
When I pick the file stored on my iPad FileChooser closes but nothing happens.  
I have copied the code from the DialogsDemo.h:

```
fc.reset (new FileChooser ("Choose a file to open...", File::getCurrentWorkingDirectory(),
                                           "*", useNativeVersion));

            fc->launchAsync (FileBrowserComponent::canSelectMultipleItems | FileBrowserComponent::openMode
                                 | FileBrowserComponent::canSelectFiles,
                             [] (const FileChooser& chooser)
                             {
                                 String chosen;
                                 auto results = chooser.getURLResults();

                                 for (auto result : results)
                                     chosen << (result.isLocalFile() ? result.getLocalFile().getFullPathName()
                                                                     : result.toString (false)) << "\n";

                                 AlertWindow::showMessageBoxAsync (AlertWindow::InfoIcon,
                                                                   "File Chooser...",
                                                                   "You picked: " + chosen);
                             });

```

According to this code there should come up a MessageBoy but it does not.  
I am pretty sure, that I am doing something wrong, but cannot find it.  
I enabled iCloud permission and Support Document Browser in Projucer. Am working with JUCE v5.4.1.

Please help!

Raphael

---

<div class="post-metadata">

**Author:** ![BrandonWu](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@BrandonWu](https://forum.juce.com/u/BrandonWu)\
**Post date:** [December 30, 2019, 12:54am UTC](https://forum.juce.com/t/trouble-with-filechooser-on-ios/30721/2 "2019-12-30T00:54:21Z")

</div>

Same problem! Hope for an update.

---

<div class="post-metadata">

**Author:** ![jwatson53](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@jwatson53](https://forum.juce.com/u/jwatson53)\
**Post date:** [August 13, 2022, 9:43am UTC](https://forum.juce.com/t/trouble-with-filechooser-on-ios/30721/3 "2022-08-13T09:43:02Z")

</div>

I have just encountered this. (JUCE 7 with and iOS simulator) Using a JUCE non native dialog on open seems to work

---

<div class="post-metadata">

**Author:** ![jwatson53](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@jwatson53](https://forum.juce.com/u/jwatson53)\
**Post date:** [August 13, 2022, 1:26pm UTC](https://forum.juce.com/t/trouble-with-filechooser-on-ios/30721/4 "2022-08-13T13:26:01Z")

</div>

This seems to be a filepattern problem. When I use an empty string instead of \*_.rep_ I can select the files.  
In **class** FileChooser::Native the following line gives v. different results.  
auto utTypeArray = createNSArrayFromStringArray (getUTTypesForWildcards (owner.filters, firstFileExtension));

When the wildcard is the empty string this results in a single element containing “public.data”.  
When the wildcard is “\*.rep” the element contains “dyn.age81e3pu”

No idea if that’s useful

---

<div class="post-metadata">

**Author:** ![jwatson53](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@jwatson53](https://forum.juce.com/u/jwatson53)\
**Post date:** [August 14, 2022, 12:44pm UTC](https://forum.juce.com/t/trouble-with-filechooser-on-ios/30721/5 "2022-08-14T12:44:14Z")

</div>

Turns out that if you need to use the Native File Browser on iOS to load a file with an extension you need to register that extension using a custom plist or just use the empty string wildcard
