uploader.on('fileQueued', function (file) {
console.log(file);
WebUploader.Runtime.Html5.Util.parseMeta(file.source, function (error, ret) {
var lat = ret.exif.get(0x0002);
var lon = ret.exif.get(0x0004);
if (lat !== undefined || lon !== undefined) {
console.log(lat);
}else {
//alert("图片没有gps信息");
uploader.onError("图片没有gps信息");
return false;
//$( '#'+file.id ).find('p.state').text('上传出错');
}
});
});
为什么弹出后 还能上传 !
uploader.on('beforeFileQueued', function (file) {
WebUploader.Runtime.Html5.Util.parseMeta(file.source, function (error, ret) {
var lat = ret.exif.get(0x0002);
var lon = ret.exif.get(0x0004);
if (lat !== undefined || lon !== undefined) {
console.log(lat);
} else {
//uploader.onError("图片没有gps信息");
return false;
}
});
});
这么写还是不行
多看看API文档啊 http://fex.baidu.com/webuploa...
fileQueued
是当文件被加入队列以后触发。都加入到队列了,返回false有毛用
**用
beforeFileQueued
是当文件被加入队列之前触发,此事件的handler返回值为false,则此文件不会被添加进入队列。**