我正在尝试将音频文件上传到服务器,但每次备用上传都会失败。
E/FileTransfer(10242): {"target":"http:\/\/abc:8080\/foldername\/foldername\/test.php?" , "source":"file:\/\/\/storage\/sdcard0\/voice.wav","code":3}
E/FileTransfer(10242): java.io.EOFException
我的代码:
var gotFileSystem = function(fileSystem) {
fileSystem.root.getDirectory(dirName, {
create : true
}, function(dataDir) {
fileURI = dataDir.fullPath;
fileURI = fileURI + '/' + fileName;
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
options.mimeType = fileMime;
$.mobile.showPageLoadingMsg();
var ft = new FileTransfer();
ft.upload(fileURI, encodeURI(url), win, fail, options);
$.mobile.hidePageLoadingMsg();
}, dirFail);
};