schimanski Well-Known Member Licensed User Longtime User Apr 13, 2014 #1 I get different pathes from my startingintent with Intent.ExtrasToString like the followings: B4X: Path=file:///storage/extSdCard/Download/test.txt Path=file:///storage/emulated/0/.... Path=file:///storage/sdcard0/.... and it seems, that these pathes are always different on different devices. Now I want to use the path to work with like file.copy, but the operations doesn't accept a path which begins with file:/// B4X: File.Copy("", Path, File.DirRootExternal , test.txt) Is there a solution which works for all pathes?
I get different pathes from my startingintent with Intent.ExtrasToString like the followings: B4X: Path=file:///storage/extSdCard/Download/test.txt Path=file:///storage/emulated/0/.... Path=file:///storage/sdcard0/.... and it seems, that these pathes are always different on different devices. Now I want to use the path to work with like file.copy, but the operations doesn't accept a path which begins with file:/// B4X: File.Copy("", Path, File.DirRootExternal , test.txt) Is there a solution which works for all pathes?
NJDude Expert Licensed User Longtime User Apr 13, 2014 #2 You have to use DirDefaultExternal, DirRootExternal to access those locations, since as you found out those locations vary from device to device, however, you could parse the result and extract the path and file name. Upvote 0
You have to use DirDefaultExternal, DirRootExternal to access those locations, since as you found out those locations vary from device to device, however, you could parse the result and extract the path and file name.
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2014 #3 You just need to remove "file://" from the string. Upvote 0