mp3 file upload with phonegap on Windows RT [ Unicode Mapping error ]

0

I used phogap function for recording audio and uploading audio , file. Audio File is recording and stored in music folder and I get the path and name of the file by the below function.

 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);
        }   

I call the function to upload the created audio file.

function uplod() {
            var options = new FileUploadOptions();
            options.fileKey = "file";
            options.fileName = name;
            options.mimeType = "audio/mpeg";
            options.chunkedMode = false;

            var ft = new FileTransfer();
            ft.upload(temp,
                      "http:/URL/upload.php",
                      function (result) {
                          alert("success" + result.bytesSent + result.responseCode);
                          console.log('Upload success: ' + result.responseCode);
                          console.log(result.bytesSent + ' bytes sent');
                      },
                      function (error) {
                          console.log('Error uploading file ' + recordingPath + ': ' + error.code);
                      },
                      options);
        }

But on running, I get these error, got stucked up, is the error is with URL or PATH ? Unicode ? and path of file is like this

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.
javascript
jquery
windows-8
visual-studio-2012
cordova
asked on Stack Overflow May 25, 2013 by Abraham K • edited May 9, 2018 by Cœur

1 Answer

0

I got the answer by using Ajax post and by using Formdata() to server there by getting in the form of arrays.

answered on Stack Overflow May 27, 2013 by Abraham K

User contributions licensed under CC BY-SA 3.0