Recuperar arquivo no Grails com cordova
14/02/2014 18:33
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=path.substr(path.lastIndexOf('/')+1);
options.mimeType="audio/mp4a-latm";
(function (currentPath, currentName) {
console.log(currentPath);
ft.upload(currentPath, "http://abc:8080/api/asd/", function (result) {
console.log('Upload success: ' + result.responseCode);
console.log(result.bytesSent + ' bytes sent');
console.log("path:" + currentPath);
window.resolveLocalFileSystemURI(currentPath, successRemove, fail);
},
function (error) {
console.log('Error uploading file ' + currentPath + ': ' + error.code);
},
{ fileName: currentName });
})(path, name);
}
Para se registrar, clique aqui.