webuploader在ie7下的flash模式的使用
webuploader在ie7下不能使用h5模式上传图片,只能使用flash模式。
但是出现了几个问题:(1)必须正确的引入.swf文件,才能使webuploader正常运行
(2)正常传输模式下,flash模式使用的md5不能上传太大的文件,(好像只能上传50k左右),所以要改成二进制流sendAsBinary
的模式上传
(3)二进制上传的使用file_get_contents(‘php://input’)获取上传内容(自己百度)
代码:html
<div class="descriptPic" style="color:red;margin:0 -100px 4px;"> <label id="contactpic" style="width:100px;color:#727272;">问题截图:</label> <!-- <input type="file" name="descriptPic[]" value="选择图片"/> --> <div id="uploader" class="uploader" style="width: 400px;float:left;margin-bottom: 15px;"> <div class="queueList"> <div class="webuploader-container" id="filePicker" style=" width: 150px;"> <div style="position: absolute;top: 0;left: 0;width: 150px;height: 45px;overflow: hidden;bottom: auto;right: auto;" id="rt_rt_1aec5bmr5qg9m5o1eat1pahqe1"> <input accept="image/*" multiple="multiple" class="webuploader-element-invisible" name="file" type="file" style="margin-left:0;margin-right:0;width:150px;height:40px;"/> <label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255) none repeat scroll 0% 0%;"> </label> </div> </div> <ul class="filelist"></ul> </div> <div class="statusBar"> <div class="progress" style="display: none;"> <span class="text">0%</span> <span class="percentage" style="width: 0%;"></span> </div><div class="info" style="color: #5A5A5A;font-size: 15px ">共0张(0B),已上传0张</div> <div class="btns"> </div> <div class="uploadBtn state-ready" id="uploadBtn" οnclick="check_upload_type()" style="CURSOR:pointer;width: 390px;margin-top: 5px;">提交</div> </div> </div> </div>
js:
<script type="text/javascript"> // 添加全局站点信息 var BASE_URL = '{$smarty.const.THEME_URL}'; //alert(BASE_URL); </script> <script type="text/javascript" src="js/webuploader.js"></script> <script type="text/javascript"> var upload_type=1; var p_name=document.getElementById('p_name'); p_name.value = new Date().getTime(); var $ = jQuery, $list = $('#fileList'), $wrap = $('#uploader'), // 图片容器 $queue = $('<ul class="filelist"></ul>').appendTo( $wrap.find('.queueList') ), // 状态栏,包括进度和控制按钮 $statusBar = $wrap.find('.statusBar'), // 文件总体选择信息。 $info = $statusBar.find('.info'), // 上传按钮 $upload = $wrap.find('.uploadBtn'), // 没选择文件之前的内容。 $placeHolder = $wrap.find('.placeholder'), // 总体进度条 $progress = $statusBar.find('.progress').hide(), // 添加的文件数量 fileCount = 0, // 添加的文件总大小 fileSize = 0, // 优化retina, 在retina下这个值是2 ratio = window.devicePixelRatio || 1, // 缩略图大小 thumbnailWidth = 110 * ratio, thumbnailHeight = 110 * ratio, // 可能有pedding, ready, uploading, confirm, done. state = 'pedding', // 所有文件的进度信息,key为file id percentages = {}, supportTransition = (function(){var s = document.createElement('p').style, r = 'transition' in s ||'WebkitTransition' in s ||'MozTransition' in s ||'msTransition' in s ||'OTransition' in s; s = null; return r; })(), // WebUploader实例 uploader; if ( !WebUploader.Uploader.support() ) {alert( 'Web Uploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器'); throw new Error( 'WebUploader does not support the browser you are using.' ); }// 初始化Web Uploader uploader = WebUploader.create({runtimeOrder:'flash', pick: {id: '#filePicker', innerHTML: '点击选择图片' }, fileNumLimit:6, //auto: true, method:'post', accept: {title: 'Images', extensions: 'gif,jpg,jpeg,bmp,png', mimeTypes: 'image/*' }, // swf文件路径 swf:BASE_URL+ 'Public/images/Uploader.swf', //disableGlobalDnd: true, sendAsBinary:true, chunked: true, server: '{url m="FeedBack" a="imageupload"}', fileSizeLimit: 5 * 1024 * 1024, // 200 M fileSingleSizeLimit: 1 * 1024 * 1024 // 50 M });
其它引入的文件跟webuploader实例一样。因为使用了框架,所以可能有点乱
webuploader在ie7下的flash模式的使用相关推荐
- nand flash 经典 全面 ------如何编写Linux下Nand Flash驱动
Crifan Li 摘要 本文先解释了Nand Flash相关的一些名词,再从Flash硬件机制开始,介绍到Nand Flash的常见的物理特性,且深入介绍了Nand Flash的一些高级功能,然后开 ...
- 如何编写linux下nand flash驱动
http://www.cnblogs.com/sankye/articles/1638852.html 向作者Sankye致敬 [编写驱动之前要了解的知识] 1. 硬件特性: [Flash ...
- 一句white-space:nowrap解决IE6,IE7下浮动元素不自动换行
一句white-space:nowrap解决IE6,IE7下浮动元素不自动换行 转载于:https://www.cnblogs.com/mabelstyle/p/3844739.html
- IE7下元素的 'padding-top' 遇到 'clear' 特性在某些情况下复制到 'padding-bottom'
项目中使用的是DIV+CSS布局,有一个页面是同事完成的,这几天他请假有事.项目发现一个UI Bug.在IE7下,某一个Div的padding-top会让整个div产生padding-bottom样式 ...
- Linux系统下使用桥接模式,无法ping通外网解决问题方案!
Linux系统下使用桥接模式,无法ping通外网解决问题方案! 参考文章: (1)Linux系统下使用桥接模式,无法ping通外网解决问题方案! (2)https://www.cnblogs.com/ ...
- IE6/IE7下:inline-block解决方案
IE6/IE7下对display:inline-block的支持性不好. 1.inline元素的display属性设置为inline-block时,所有的浏览器都支持: 2.block元素的displ ...
- IE6/IE7下:inline-block不兼容的问题
IE6/IE7下对display:inline-block的支持性不好. 1.inline元素的display属性设置为inline-block时,所有的浏览器都支持: 2.block元素 ...
- 中止取消ajax请求,IE7下的bug解决
最近做了一个基于文本框智能提示的效果,效果大致如下 当我每输入一个字符,通过ajax请求并返回匹配的结果.输入第一个字符时,ajax的请求已经开始,输入第二字符时又一个ajax请求,这样的话,用户输入 ...
- linux 在文本模式下(命令模式)下,中文是乱码,如何解决?
linux 在文本模式下(命令模式)下,中文是乱码,如何解决? 转载于:https://blog.51cto.com/renxi/449690
最新文章
- 【TensorFlow】:Eager Mode(动态图模式)
- struts2 spring jfreechart 整合
- 计算机在课堂中的应用论文,任务教学法在计算机教学中的应用论文
- 钱大妈数据中台建设最佳实践
- idea工作台输出的日志详解_详解linux下nohup日志输出过大问题解决方案--分批切割...
- 低代码:如何保障开发安全性?
- 大事件后台管理系统开发实战(中)
- svn 提交 working copy is not up-to-date
- 计算机算法设计与分析 大学生电影节观影问题
- [Android]Eclipse连不上模拟器的问题[emulator-5554 disconnected]
- AndroidTestCase常用的两段配置
- 如何在电脑上删除磁盘碎片
- python assert_Python中何时使用断言 assert
- Opencv+pycharm+anaconda配置
- 易语言_酷Q机器人插件_01
- win10下能够用的键盘映射工具? win10 下按键像mac一样
- 质疑 追寻 与成果出版——读戴德金1872年《连续性和无理数》之1
- 如何简单又好看地美化你的Ubuntu界面
- 利用Python开发一个微信定时发送器
- 之和质数c语言题判断,C语言经典例题100例——C语言练习实例33解答(质数判断)...
热门文章
- Dubbo SpringBoot 实战
- 喜迎双十一 西数助你全面提升存储解决方案
- Java位运算之2的N次幂、整数转换、寻找只出现一次的数
- 【Java位运算】Java中整数取反(位操作)
- 基于ARM嵌入式工控机主板的人机界面组态软件开发方案
- 高考计算机如何检索投档,高考平行志愿投档规则是什么
- 动漫|小青|言叶之庭|IU|美女|鸟|全面屏手机壁纸
- vr安全教育消防安全循序渐进地开展火灾知识、技能及实训教学
- You asked to pull from the remote ‘‘master‘‘, but did not specify a branch
- CSS如何实现双飞翼布局?