七牛html js上传带进度条源码
七牛html js上传带进度条源码
注册链接https://s.qiniu.com/uM7RJv
完整代码下载:
https://n802.com/f/349707-489018989-c141f6(访问密码:5036)
http://www.yimuhe.com/file-4879048.html
https://www.90pan.com/b2462703 密码:5y07
<script type="text/javascript"> var token = "";//上传token var fname = "";//生成后的文件路径及文件名 var domain = "";//完整个域名用于生成完整图片路径 var config = { useCdnDomain: true, disableStatisticsReport: false, retryCount: 6, region: qiniu.region.z1 //七牛服务器 华东z0 华北z1 华南z2 北美na0 新加坡as0 }; </script> <link rel="stylesheet" type="text/css" href="qiniu/circle.css" /> <script type="text/javascript" src="qiniu/qiniu.min.js"></script> <div> <div class="upload_img_hanchao"> <ul class="clearfix" style="margin:8px 0;"> <li style="padding:0;"> <input type="text" id="goods_video" name="goods_video" style="" class="upvideoinputa" value="" /> </li> <div id="filed"> <button class="btn btn-primary">上传视频</button> <input accept="audio/mp4,video/mp4" class="file-input" type="file" id="goods_video_filebutton" /> </div> </ul> <div class="circle-bar hide" id="goods_video_totalBar"> <div class="circle-bar-left"></div> <div class="circle-bar-right"></div> <div class="mask"><span class="percent speed">0%</span></div> </div> </div> </div> <script> var callback = function(res) { if (res.status) { $("#goods_video").val(domain + "/" + res.key); } else { alert("上传出错" + res.message); } }; var putExtra = { obj: "#goods_video_filebutton", barobj: "#goods_video_totalBar", fname: "", params: {}, mimeType: ["audio\/mp4", "video\/mp4"] }; uploadWithSDK(token, putExtra, config, callback); </script>