The TiExplorer module enables you to read files from Internal/External storage and save in your application specific folder which you selected.
This project can be found on github at https://github.com/wecobi/TiExplorer.
Download the latest distribution ZIP-file and consult the Titanium Documentation on how install it, or simply use the gitTio CLI:
$ gittio install ti.explorer
- This is an Android module designed to work with Titanium SDK 7.0.0 or greater.
To access this module from JavaScript, you would do the following:
var TiExplorer = require("ti.explorer");
TiExplorer.selectFile({
mimeType: "application/vnd.ms-excel",
location: TiExplorer.EXTERNAL_STORAGE,
onSuccess: function(e) {
if(e.status == TiExplorer.RESULT_OK) {
// Success Received
var fileObj = e.file || null;
if(fileObj != null) {
alert("File Created Successfully!");
}
}
},
onError: function(e) {
Ti.API.info("onError>>>> " + JSON.stringify(e));
}
});
You can create an request for SelectFile using below properties
- mimeType (Optional) (String) MimeType of file you want to read. (Default, /)
- location (Optional) (Constant) TiExplorer Defined Constant used to give location of file. (Default, CACHE_DIRECTORY)
- onSuccess (Required) (Function) Successful response, then you can get response in here.
- onSuccess (Required) (Function) An Error response you get here.
- RESULT_OK
- RESULT_CANCELED
- RESULT_ERROR
- EXTERNAL_STORAGE
- CACHE_DIRECTORY
- DATA_DIRECTORY
- EXTERNAL_CACHE_DIRECTORY
- Abidhusain Chidi
- abidhusain@qalbit.com
This project is licensed under the MIT approved License. For details please see the license associated with each project.