0
var con = new UIDocumentPickerController();

I’m using the code above for my DocumentPicker but whenever I pick a file that is for example over 500 megabytes, the app freezes and crashes out. After that, the phone loses the control and restarts. Everything works fine on smaller files. What can I do to handle this? Thanks. I guess that iOS takes a little bit of time to move the file to tmp folder...

SCFSOF
  • 13
  • 4
  • Hi, maybe size of file is too large, there is a limit about `UIDocumentPickerController`.Having a try with to smaller size of file ,such as 1 megabytes. – Junior Jiang Aug 27 '19 at 02:58
  • I am not sure why do you have a 500MB document in your mobile device but that is much above the limit of `UIDocumentPickerViewController` – FreakyAli Aug 27 '19 at 05:28
  • Is it the same if you open in place instead of importing? – Thomas Deniau Aug 27 '19 at 17:10
  • @JuniorJiang-MSFT Even when I use the Open In menu to open the file in my app, it doesn’t get handled. I don’t think the problem is with `UIDocumentPickerController` – SCFSOF Aug 28 '19 at 14:49
  • @G.hakim The app that I have written is an app for saving documents and listing them so I’ll need to open any kind of file in any size. – SCFSOF Aug 28 '19 at 14:50
  • @ThomasDeniau Yes, it’s still the same. – SCFSOF Aug 28 '19 at 14:51
  • @SCFSOF I don't think this is a good design. I still recommend testing whether the opening of small files is successful. If the size of image is large , there will need more timer to prepare opening .And when preparing more long time, will fail to open more possiblely. – Junior Jiang Aug 29 '19 at 02:22
  • @JuniorJiang-MSFT Yes. Smaller files work fine. Can we make sure about the timer? On some phones the process might be faster or slower, there is no way to predict it and putting long timers might be frustrating. Any suggestions then sir? – SCFSOF Aug 29 '19 at 18:23
  • @JuniorJiang-MSFT Also, when a file is sent by another application to my app, the same incident happens. – SCFSOF Aug 29 '19 at 18:34
  • @JuniorJiang-MSFT But sir, I’ve seen some apps that when you want to import a file to them, even the big ones, those apps do not get opened until the file is completely imported to the application’s directory and this process is controlled by iOS, not the application itself because it gets opened or loaded after the importation is done. – SCFSOF Aug 30 '19 at 00:20
  • @SCFSOF UIDocumentPickerController has four models , you can have a look, maybe helpful. .https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller?language=objc – Junior Jiang Aug 30 '19 at 05:36
  • I think you should file a bug with Apple about this. – Thomas Deniau Oct 21 '19 at 14:11

0 Answers0