双十一买到假货的比例京东买到假货

我自己做的图片要怎么上传到网上了才能让别人在百度里搜索的到呢
本回答由提问者推荐
var sogou_ad_id=731547;
var sogou_ad_height=160;
var sogou_ad_width=690;我要上传多份资料图片合成为一个完整的文件,可是我不会传,只会一张一张地传图,而且我不知道怎么样把图片和资料合成在一起再上传&请指教!!
把准备打包的资料全部选中,单击右键,添加到压缩文档,就OK了,试一下就知道了,很简单的
首先安装winrar软件,然后选中所有要压缩的图片,点击鼠标右键,
选择压缩到...
剩下的你就会了
压缩可以分为有损和无损压缩两种。
有损压缩广泛应用于动画、声音和图像文件中,典型的代表就是影碟文件格式mpeg、音乐文件格式mp3和图像文件格式jpg。但...
上传图片时可以把图片放入到文件夹,然后压缩,只要不超过3M容量,就可以一次性上传共享。
大家还关注
确定举报此问题
举报原因(必选):
广告或垃圾信息
激进时政或意识形态话题
不雅词句或人身攻击
侵犯他人隐私
其它违法和不良信息
报告,这不是个问题
报告原因(必选):
这不是个问题
这个问题分类似乎错了
这个不是我熟悉的地区查看: 37644|回复: 2
移动端html5图片上传方法【更好的兼容安卓IOS和微信】
主题帖子积分
之前的移动端上传的方法,有些朋友测试说微信支持不是很好,还有部分安卓机也不支持,其实我已经有了另一个方法,但是例子还没整理出来,而联系我的很多朋友需要,所以就提前先发出来了,并且做一个简单的说明,就不做一个demo了。
&!doctype html&
&meta charset=&utf-8&&
&meta name=&viewport& content=&width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0&&
&title&图片压缩&/title&
body { margin:0; padding:0; }
html { font-size:62.5%; }
.imgzip { padding:1 }
.imgzip .itm { padding-bottom:1 word-break:break- font-size:1.2 line-height:1.5 }
.imgzip .itm .tit { margin-bottom:.5 background-color:#e71446; color:#FFF; padding:.5rem 1 border-radius:3 }
.imgzip .itm .cnt { padding:1 }
.imgzip .itm .cnt img { display: max-width:100%; }
.imgzip textarea { width:100%; height:20 }
&script src=&/jquery-1.8.3.js&&&/script&
&input type=&file& accept=&image/*;capture=camera& class=&input&&
&div class=&imgzip&&&/div&
document.addEventListener('DOMContentLoaded', init, false);
function init() {
var u = new UploadPic();
input: document.querySelector('.input'),
callback: function (base64) {
url:&{:U('upload')}&,
data:{str:base64,type:this.fileType},
type:'post',
dataType:'json',
success:function(i){
loading: function () {
function UploadPic() {
this.sw = 0;
this.sh = 0;
this.tw = 0;
this.th = 0;
this.scale = 0;
this.maxWidth = 0;
this.maxHeight = 0;
this.maxSize = 0;
this.fileSize = 0;
this.fileDate =
this.fileType = '';
this.fileName = '';
this.input =
this.canvas =
this.mime = {};
this.type = '';
this.callback = function () {};
this.loading = function () {};
UploadPic.prototype.init = function (options) {
this.maxWidth = options.maxWidth || 800;
this.maxHeight = options.maxHeight || 600;
this.maxSize = options.maxSize || 3 * 1024 * 1024;
this.input = options.
this.mime = {'png': 'image/png', 'jpg': 'image/jpeg', 'jpeg': 'image/jpeg', 'bmp': 'image/bmp'};
this.callback = options.callback || function () {};
this.loading = options.loading || function () {};
this._addEvent();
* @description 绑定事件
* @param {Object} elm 元素
* @param {Function} fn 绑定函数
UploadPic.prototype._addEvent = function () {
var _this =
function tmpSelectFile(ev) {
_this._handelSelectFile(ev);
this.input.addEventListener('change', tmpSelectFile, false);
* @description 绑定事件
* @param {Object} elm 元素
* @param {Function} fn 绑定函数
UploadPic.prototype._handelSelectFile = function (ev) {
var file = ev.target.files[0];
this.type = file.type
// 如果没有文件类型,则通过后缀名判断(解决微信及360浏览器无法获取图片类型问题)
if (!this.type) {
this.type = this.mime[file.name.match(/\.([^\.]+)$/i)[1]];
if (!/image.(png|jpg|jpeg|bmp)/.test(this.type)) {
alert('选择的文件类型不是图片');
if (file.size & this.maxSize) {
alert('选择文件大于' + this.maxSize / 1024 / 1024 + 'M,请重新选择');
this.fileName = file.
this.fileSize = file.
this.fileType = this.
this.fileDate = file.lastModifiedD
this._readImage(file);
* @description 读取图片文件
* @param {Object} image 图片文件
UploadPic.prototype._readImage = function (file) {
var _this =
function tmpCreateImage(uri) {
_this._createImage(uri);
this.loading();
this._getURI(file, tmpCreateImage);
* @description 通过文件获得URI
* @param {Object} file 文件
* @param {Function} callback 回调函数,返回文件对应URI
* return {Bool} 返回false
UploadPic.prototype._getURI = function (file, callback) {
var reader = new FileReader();
var _this =
function tmpLoad() {
// 头不带图片格式,需填写格式
var re = /^data:base64,/;
var ret = this.result + '';
if (re.test(ret)) ret = ret.replace(re, 'data:' + _this.mime[_this.fileType] + ';base64,');
callback && callback(ret);
reader.onload = tmpL
reader.readAsDataURL(file);
* @description 创建图片
* @param {Object} image 图片文件
UploadPic.prototype._createImage = function (uri) {
var img = new Image();
var _this =
function tmpLoad() {
_this._drawImage(this);
img.onload = tmpL
* @description 创建Canvas将图片画至其中,并获得压缩后的文件
* @param {Object} img 图片文件
* @param {Number} width 图片最大宽度
* @param {Number} height 图片最大高度
* @param {Function} callback 回调函数,参数为图片base64编码
* return {Object} 返回压缩后的图片
UploadPic.prototype._drawImage = function (img, callback) {
this.sw = img.
this.sh = img.
this.tw = img.
this.th = img.
this.scale = (this.tw / this.th).toFixed(2);
if (this.sw & this.maxWidth) {
this.sw = this.maxW
this.sh = Math.round(this.sw / this.scale);
if (this.sh & this.maxHeight) {
this.sh = this.maxH
this.sw = Math.round(this.sh * this.scale);
this.canvas = document.createElement('canvas');
var ctx = this.canvas.getContext('2d');
this.canvas.width = this.
this.canvas.height = this.
ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, this.sw, this.sh);
this.callback(this.canvas.toDataURL(this.type));
ctx.clearRect(0, 0, this.tw, this.th);
this.canvas.width = 0;
this.canvas.height = 0;
this.canvas =
&/html&复制代码
这个也是把图片转成了base64去传送,个人不建议去用js改变图片的大小,建议裁切缩放还是PHP来做吧。
this.maxWidth = options.maxWidth || 800;
this.maxHeight = options.maxHeight || 600;
this.maxSize = options.maxSize || 3 * 1024 * 1024;
this.input = options.
this.mime = {'png': 'image/png', 'jpg': 'image/jpeg', 'jpeg': 'image/jpeg', 'bmp': 'image/bmp'};复制代码
这一部分是对上传图片的配置,应该可以看懂,可以自己去改
url:&{:U('upload')}&,
data:{str:base64,type:this.fileType},
type:'post',
dataType:'json',
success:function(i){
这部分是上传以后ajax发送base64码到php,
base64码带有图片的说明字符串,所以得用正则去掉,然后base64解码保存到图片的文件中。并且返回地址即可
原文来自:
主题帖子积分
注册会员, 积分 110, 距离下一级还需 90 积分
注册会员, 积分 110, 距离下一级还需 90 积分
要是有demo就好了
主题帖子积分
新手上路, 积分 4, 距离下一级还需 46 积分
新手上路, 积分 4, 距离下一级还需 46 积分
手机端上传图片EXIF信息会丢失,不知道怎么回事,同样的代码PC端上传就没问题
站长推荐 /1
Ionic(ionicframework)号称未来最有潜力的一款html5移动app开发框架是Angularjs移动端解决方案,Angularjs号称下一代web应用,Ionic移动app开发教程值得拥有
Powered by怎样将图片发到网上_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
怎样将图片发到网上
上传于|0|0|暂无简介
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 双十一假货率 的文章

 

随机推荐