phonegap文件传输无法正常工作

时间:2014-07-21 15:15:06

标签: android cordova phonegap-plugins

我正在使用phonegap 3.5,我使用该代码将文件传输到远程服务器

   function uploadPhoto(imageURI) {

        var options = new FileUploadOptions();

        alert(typeof FileUploadOptions === "undefined");
        options.fileKey="file";
        options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
        options.mimeType="image/jpeg";
  options.headers = {
    Connection: "close"
   };
     options.chunkedMode = false;
        var params = {};
        params.value1 = "test";
        params.value2 = "param";

        options.params = params;
alert("object is " + options.fileName);

 alert(typeof FileTransfer === "undefined");
        var ft = new FileTransfer();

        ft.upload(imageURI, encodeURI("myserver url "), win, fail, options);
    }
如果我为文件和文件传输

安装了两个插件,

文件传输是未定义的

0 个答案:

没有答案