Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How do I allow a user to browse to a file on iOS?
Started by zimmwisdom Feb 02 2020 02:21 AM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

zimmwisdom

[GLOBAL: userInfoPane.html]
zimmwisdom
  • Observer

  • 4 posts
  • Corona SDK

My app allows users to export their data to a text file, in order to move it to a new device, if they need to.

 

On iOS, how do I allow a user to browse their device's file system to find this file, for import back into my app?

 

For Android, I use the CnkFileManager's "pickfile" function, but this plugin doesn't support iOS.



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,622 posts
  • Enterprise

iOS doesn't allow you to explore the device's file system. You are limited to the four sandbox folders. In Corona terms, you most likely would save files to system.DocumentsDirectory and use the LFS functions to get a list of files and present them to the user. There is no Corona supported "File Picker", though there might be a plugin in the Marketplace.

 

Rob



[TOPIC: post.html]
#3

norman.rozental

[GLOBAL: userInfoPane.html]
norman.rozental
  • Enthusiast

  • 87 posts
  • Corona SDK

You can use the Doc Picker plugin which I've used in the past.  The plugin was updated last year.

 

https://marketplace.coronalabs.com/corona-plugins/doc-picker

 

Docs: https://scotth.tech/plugin-docPicker



[TOPIC: post.html]
#4

zimmwisdom

[GLOBAL: userInfoPane.html]
zimmwisdom
  • Observer

  • 4 posts
  • Corona SDK

Thank you for the replies, I have a follow up question.

 

Q: When a user saves an email attachment "To My iPhone", is that the equivalent to the DocumentDirectory corona's system library provides access to?




[topic_controls]
[/topic_controls]