我需要下载一个文件,但我没有他的名字。我尝试下载而不指定他的名字。按照我的代码
$("#sincronizar").click( function(){
var localFileName = "ico/recebe/";
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
fileSystem.root.getFile(localFileName, {create: true, exclusive: false}, function(fileEntry) {
var localPath = fileEntry.fullPath;
var url = "http://192.168.250.100:5000/envia_arquivo/?username=dlemes&password=101112";
var onSucess = function(entry) {
alert("download complete: " + entry.fullPath);
//extractFile();
};
var onError = function(error) {
alert("Erro ao buscar fonte de dados: " + error.source);
alert("Código do erro: " + error.code);
};
var ft = new FileTransfer();
ft.download(url,localPath, onSucess, onError);
});
});
});