Hi
The scenario that I'm trying to address is, on Android:
1) User A emails a data file to user B
2) Within their email programme, User B selects the option to "download" the data file
The data file is now sitting in a "Download" folder of user B's Android device.
I know that, in general, Android ring-fences the data specific to each app, but it seems to me that the Download folder must be an exception to this because lots of apps seem to be able to write to / read from the same Download folder.
I know that there can be more than one download folder (e.g. one on internal storage, one on external storage).
If I have a file XYZ in the download folder of an Android devices internal storage, what file path do I use to access it?
"file:" & specialFolderPath("Download") & slash & "XYZ" - would be nice, but specialFolderPath("Download") seems to only exist on my wish-list
Is the answer something to do with specialFolderPath("External Documents")?
Thanks in advance
Kim
File path to Download folder
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: File path to Download folder
Right, specialFolderPath("external documents") gives access to the public downloads folder. SpecialFolderPath(" documents") refers only to the app's sandboxed private folder. .
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: File path to Download folder
Also a point of note, on Android (and IOS too, I believe) the filesystem is case sensitive, and specialFolderPath ("documents") has a lower case "d"
Re: File path to Download folder
Thanks Jacque & Sparkout
I've ended up having to debug another problem today, but I'll try your suggestions on Monday.
Regards
Kim
I've ended up having to debug another problem today, but I'll try your suggestions on Monday.
Regards
Kim
Re: File path to Download folder
Hi
FYI
With a sample size of one (Android 5.01) test device:
- I couldn't get specialFolderPath("external documents") to work. This evaluated to "/storage/emulated/0/android/data/myappname/files", which wasn't the Download folder; but
- after a fair bit of experimentation I got "/mnt/sdcard/Download" to work. This evaluated to "/storage/emulated/legacy/Download"
I did also find a bunch of posts on stackOverflow implying that Environment.getExternalStorageState() or Environment.getDataDirectory() would give me a robust generic answer to "What's the file path to the Download folder", but I didn't know how to run an Android operating system (or is it Java) command from LC, so for the moment at least I'm going to have to run with "/mnt/sdcard/Download". Now to see if it works on a sample of later versions of Android.
Thanks for your posts
Kim
FYI
With a sample size of one (Android 5.01) test device:
- I couldn't get specialFolderPath("external documents") to work. This evaluated to "/storage/emulated/0/android/data/myappname/files", which wasn't the Download folder; but
- after a fair bit of experimentation I got "/mnt/sdcard/Download" to work. This evaluated to "/storage/emulated/legacy/Download"
I did also find a bunch of posts on stackOverflow implying that Environment.getExternalStorageState() or Environment.getDataDirectory() would give me a robust generic answer to "What's the file path to the Download folder", but I didn't know how to run an Android operating system (or is it Java) command from LC, so for the moment at least I'm going to have to run with "/mnt/sdcard/Download". Now to see if it works on a sample of later versions of Android.
Thanks for your posts
Kim