|

楼主 |
发表于 2017-3-7 21:36:12
|
显示全部楼层
我看从相册选择后获取的是一堆字符串传到后台的
if(!navigator.camera){
return;
}
var self = this;
navigator.camera.getPicture(onSuccess, onFail, {
mediaType : 0,//只选择图片
quality:80,
allowEdit:true,
targetWidth:400,
targetHeight:400,
destinationType: navigator.camera.DestinationType.DATA_URL,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
//sourceType: navigator.camera.PictureSourceType.PhotoAlbum//在安卓中,这个参数会跳出拍照界面
});
function onSuccess(imageData) {
//图片上传
self.uploadPic(imageData);
}
function onFail(message) {
// alert('Failed because: ' + message);
}
就是这个imageData
我现在在pc端,用input上传图片的,上传的这个图片怎么能获取到这个imageData字符串的值啊 |
|