PhoneGap中文网

 找回密码
 立即注册
查看: 12134|回复: 0
打印 上一主题 下一主题

input file 路径 fakepath 怎么解决

[复制链接]

1

主题

1

帖子

9

积分

新手上路

Rank: 1

积分
9
跳转到指定楼层
楼主
发表于 2016-3-29 16:58:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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);   

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

ionic4视频教程

Archiver|手机版|小黑屋| PhoneGap中文网 ( 京ICP备13027796号-1 )  

GMT+8, 2024-4-25 13:08 , Processed in 0.039749 second(s), 34 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表