将音频传输到服务器cordova

I am using the cordova media plugin to record voice.Once i have recorded it. i want to send it to server.For that i am using FileUpload and FileTransfer.But i am facing problem in getting the recorded file.How to get the recorded audio file? I have been through cordova file plugin documentation,but didnt understand properly. and i found this error code 1 i use cordova and php .it not working for me can you help please.

<html>
<head>
    <script src="cordova.js"></script>
    <script src="mvc/js/jquery.min.js"></script>
    <script>
            var filename;         
        var mediaRec;
         function recordAudio() {
        filename = new Date().getTime();

        mediaRec = new Media(filename, onSuccess, onError);
        mediaRec.startRecord();


    }
    function onSuccess(){

        alert("onSuccess  "   +filename );   
    }
    function onError(){}
     function stopRecord(fileName){

         mediaRec.stopRecord();
        uploadVoice(filename,"");


    }


        function uploadVoice(fileName, dirName) {

    var win = function (r) {

        alert("Code = " + r.responseCode);
        console.log("Response = " + r.response);
        console.log("Sent = " + r.bytesSent);
    };

    var fail = function(error) {

        alert("fail  "+error.code );
        alert("Source = " + error.source );
        alert("Target = " + error.target)
};

    // file system fail
    var fsFail = function(error) {
        alert("file system error");
  //alert("fsfail  "+error.code);
    };

    var dirFail = function(error) {
        alert("Directory error");


    };

    var fileURI;

    var gotFileSystem = function (fileSystem) {
        fileSystem.root.getDirectory(dirName, {
            create: false

        }, function (dataDir) {

            fileURI = dataDir.toURL();
          fileURI = fileURI + '/' + fileName;

            var options = new FileUploadOptions();
            options.fileKey = "file";
            options.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
            options.mimeType = "Audio/3gpp";

            options.chunkedMode = false;
options.headers = { Connection: "close" }; 

            var ft = new FileTransfer();
      ft.upload(fileURI, "url", win, fail, options);


        }, dirFail);

    };


    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFileSystem, fsFail);

}

    </script>
<body>
    <button onClick="recordAudio();">Start</button><br/><br/>
    <button onClick="stopRecord();">Stop</button>

</body>

</head>
 ft.upload(fileURI, "url", win, fail, options);

In above code, "url" must be server side script lets say php script which should handle this file and should move to specified location in server.

Please make sure that the server folder to which you are moving audio file should have necessary write permission.