Skip to content

Instantly share code, notes, and snippets.

@laerciobernardo
Created April 4, 2017 21:13
Show Gist options
  • Save laerciobernardo/5b05faa6a66eae6a3457a4414395f6ec to your computer and use it in GitHub Desktop.
Save laerciobernardo/5b05faa6a66eae6a3457a4414395f6ec to your computer and use it in GitHub Desktop.
var filesPath = ["file:///storage/emulated/0/myfile.txt","file:///storage/emulated/0/folder", "file:///storage/emulated/0/other-file.txt"];
function processFilesPaths(filesPath) {
angular.forEach(data, function (filePath) {
window.resolveLocalFileSystemURL(filePath, function (fileEntry) {
fileEntry.file(function (file) {
vm.attachments.push(file);
});
});
});
}
processFilePaths(filesPath);
PageDataService.uploadFiles(vm.attachments).then(function (result) {
console.log("RESULT UPLOAD", result)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment