PhoneGap中文网

标题: input file 路径 fakepath 怎么解决 [打印本页]

作者: kkk.    时间: 2016-3-29 16:58
标题: input file 路径 fakepath 怎么解决
var imageURI = getPath($$("#share_introduction").val());
       
        myApp.alert(imageURI);
        var options = new FileUploadOptions();
        options.fileKey="share_introduction";//等同于file的name,后台获取的就是这个
        options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
        options.mimeType="image/jpeg";
        options.chunkedMode = false;
        var ft = new FileTransfer();
       
       
        ft.upload(imageURI,
        encodeURI(server_path+"manage/upload_introduction?productId="+productId+"&type="+productType+"&content="+content+"&title="+title+"&personId="+personId),
        function(r) {
                var json = JSON.parse(r.response);//后台返回值在这个r.response里,变成json格式获取
       
       ///二维码 "E:/Tomcat7.0/webapps/E-book/static/upload/"+productId+"/image"
        },
        function(error) {
                myApp.alert("上传失败");
                return ;
        }   , options);   






欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/) Powered by Discuz! X3.2