This module written by Jorge and Rainer is an Titanium Android module for picking files from device.
var FilePicker = require("ti.filepicker");
FilePicker.getFileSelectDialog({
mimeTypes: ["*/pdf"],
suffix : ".pdf",
resultType : FilePicker.TYPE_FILE,
destinationStorage : FilePicker.TEMP_STORAGE, // or EXTERNAL_STORAGE
onSuccess : function(_e) {
var resultFile = _e.file;
}
});
In case of file result you can choose the destination with property destinationStorage In case of EXTERNAL_STORAGE don't forget to remove later … For usage of external storage on devices ≥ Marshmellow you need
Or:
var FilePicker = require("ti.filepicker");
FilePicker.getFileSelectDialog({
mimeTypes: ["*/pdf"],
resultType : FilePicker.TYPE_BLOB
onSuccess : function(_e) {
var resultBlob = _e.blob;
}
});