我不能使用phonegap 2.8.1 ... plz帮助将图片上传到服务器.. [英] i cant upload pics to the server..im using phonegap 2.8.1...plz help

查看:96
本文介绍了我不能使用phonegap 2.8.1 ... plz帮助将图片上传到服务器..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

function PostEditSpace() {
                var space =$("#txtSpaceID").val();

                alert("globimg"+globImageUrl);
                var options = new FileUploadOptions();
                options.fileKey="file";
                options.fileName=space+globImageUrl.substr(globImageUrl.lastIndexOf('/')+1);
                options.mimeType="image/jpeg";
                alert("filename"+options.fileName);
                var params = new Object();
                params.SpaceId = $("#txtSpaceID").val();
                params.CollectionImage_ImageDescription = $("#txtComment").val();
                alert("cmmnt"+ $("#txtComment").val()+"Youtube "+ $("#txtYoutube").val());
                params.Collection_ImgUrl = $("#txtPictureLink").val();
                params.CollectionImage_Video1 = $("#txtVimeo").val();
                params.CollectionImage_Video2 = $("#txtYoutube").val();
                options.params = params;
                options.chunkedMode = false;
                var ft = new FileTransfer();

                ft.upload(globImageUrl,"http://somemvc.azurewebsites.net/Home/PostCollectionImage", win, fail, options);
                alert('save data');
                console.log("#txtSpaceID= " + $("#txtSpaceID").val());
            };

推荐答案

#txtSpaceID)VAL();

alert( globimg + globImageUrl);
var options = new FileUploadOptions();
options.fileKey = file;
options.fileName = space + globImageUrl.substr(globImageUrl.lastIndexOf(' /') 1);
options.mimeType = image / jpeg;
alert( filename + options.fileName);
var params = new Object ();
params .SpaceId =
("#txtSpaceID").val(); alert("globimg"+globImageUrl); var options = new FileUploadOptions(); options.fileKey="file"; options.fileName=space+globImageUrl.substr(globImageUrl.lastIndexOf('/')+1); options.mimeType="image/jpeg"; alert("filename"+options.fileName); var params = new Object(); params.SpaceId =


< span class =code-string>#txtSpaceID)。val();
params .CollectionImage_ImageDescription =
("#txtSpaceID").val(); params.CollectionImage_ImageDescription =


< span class =code-string> #txtComment)。val();
alert( cmmnt +
("#txtComment").val(); alert("cmmnt"+


这篇关于我不能使用phonegap 2.8.1 ... plz帮助将图片上传到服务器..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆