Skip to content

Instantly share code, notes, and snippets.

Created March 17, 2016 06:35
What would you like to do?
How to access to file in storage card `/sdcard/anyfolder/myfile` in Titanium SDK
// need storage permission to be added in manifest
function getFileFromExternalStorage(path) {
if(Ti.Filesystem.isExternalStoragePresent()) {
var file = Ti.Filesystem.getFile(Ti.Filesystem.externalStorageDirectory, path);
var newPath = file.nativePath.split(Ti.Filesystem.separator +'');
file = Ti.Filesystem.getFile(newPath);
if(file.exists()) return file;
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment