Javascript 在Windows RT上使用phonegap上载mp3文件[Unicode映射错误]
我使用phogap功能录制音频并上传音频、文件。 音频文件正在录制并存储在音乐文件夹中,我通过下面的函数获取文件的路径和名称Javascript 在Windows RT上使用phonegap上载mp3文件[Unicode映射错误],javascript,jquery,windows-8,visual-studio-2012,cordova,Javascript,Jquery,Windows 8,Visual Studio 2012,Cordova,我使用phogap功能录制音频并上传音频、文件。 音频文件正在录制并存储在音乐文件夹中,我通过下面的函数获取文件的路径和名称 function captureSuccess(mediaFiles) { var i, len; for (i = 0, len = mediaFiles.length; i < len; i += 1) { uploadFile(mediaFiles[i]);
function captureSuccess(mediaFiles) {
var i, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
uploadFile(mediaFiles[i]);
}
alert('over');
}
function captureAudio() {
navigator.device.capture.captureAudio(captureSuccess, captureError, { limit: 1, duration: 10 });
}
function uploadFile(mediaFile) {
var ft = new FileTransfer(),
path = mediaFile.fullPath,
name = mediaFile.name;
temp = path; //Assigned path to GLOBAL VARIABLE
temp1 = name;
alert(temp);
}
但是在运行时,我遇到了这些错误,被卡住了,错误是URL还是路径?Unicode?文件的路径是这样的
C:/Users/AB/Music/captureAudio (4).mp3
0x80070459 - JavaScript runtime error: No mapping for the Unicode character exists in the target multi-byte code page.
WinRT information: No mapping for the Unicode character exists in the target multi-byte code page.
我通过使用Ajax post和以数组的形式使用
Formdata()
服务器得到了答案
C:/Users/AB/Music/captureAudio (4).mp3
0x80070459 - JavaScript runtime error: No mapping for the Unicode character exists in the target multi-byte code page.
WinRT information: No mapping for the Unicode character exists in the target multi-byte code page.