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: #ffffff 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" onclick="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模式的使用的更多相关文章

  1. Jlink V7在MDK下使用Cortex-M3-Jlink模式开发STM32的说明

    Jlink V7在MDK下使用Cortex-M3-Jlink模式开发STM32的说明   开发环境:STM32F103RB(128K Flash 20K RAM)+MDK3.50+JLINK V7(v ...

  2. ie6和ie7下z-index bug的解决办法

    一.匆匆带过的概念 关于CSS中层级z-index的定义啊什么的不是本文的重点,不会花费过多篇幅详细讲述.这里就简单带过,z-index伴随着层的概念产生的.网页 中,层的概念与photoshop或是 ...

  3. IE7下z-index失效问题

    看代码: HTML <div class="select-wrap"> <div class="select-name">院系</ ...

  4. 如何编写linux下nand flash驱动-4

    2.       软件方面 如果想要在Linux下编写Nand Flash驱动,那么就先要搞清楚Linux下,关于此部分的整个框架.弄明白,系统是如何管理你的nand flash的,以及,系统都帮你做 ...

  5. select2插件不兼容ie7,ie7下样子显示错位问题

    1.源文件(未修改) select2.min.css.select2.min.js 2.ie7下显示样式: 3.ie8下显示样式: 4.经查看发现ie7下对一些属性的解析和ie8不同,需对ie7另作h ...

  6. IE7下总提示" 缺少标识符、字符串或数字"

    用Jquery easyUI ,IE7下列表显示不了,总提示缺少标识符.字符串或数字.而google,maxthon,firefox,IE10等却没有问题. 原因是Json末尾多了个逗号.IE7下js ...

  7. vertical-align及IE7下的inline-block

    在IE7下,是不支持inline-block元素的,当对块级元素如dl进行inline-block样式设置时,在IE7浏览器是下样式是不会生效的. 若要在IE7下实现将块级元素设置为内联元素,可以这样 ...

  8. 2015年8月17日,杨学明老师《产业互联网化下的研发模式转型》在中国科学院下属机构CNNIC成功举办!

    2015年8月17日,杨学明老师为中国网络新闻办公室直属央企中国互联网络中心(CNNIC)提供了一天的<产业互联网化下的研发模式转型>内训课程.杨学明老师分别从产业互联网化的问题与挑战.传 ...

  9. 【css】ie6 和 ie7 下 position 与 overflow 的问题

    前几天做的项目中碰到这样一个问题,在 ie6 和 ie7 下,给父元素设置 overflow:hidden 不起作用无法隐藏,后来发现是子元素中有设置 position:relative,如果子元素删 ...

随机推荐

  1. python之类的相关知识

    面向对象技术简介 类: 用来描述具有相同的属性和方法的对象的集合.它定义了该集合中每个对象所共有的属性和方法.对象是类的实例. 类变量:类变量在整个实例化的对象中是公用的.类变量定义在类中且在函数体之 ...

  2. spring boot 测试类

    import org.junit.Test;import org.junit.runner.RunWith;import org.slf4j.Logger;import org.slf4j.Logge ...

  3. 【转】oracle 体系结构

    前几天面试的时候面试官才问过我Oracle的体系结构,让我在一张白纸上画出来.回头想想当时答得还不错,大部分内容都描述出来了,呵呵,刚才在网上看到一篇讲解ORACLE体系结构的文章,觉得不错,转过来存 ...

  4. ArcGIS案例学习笔记2_2

    ArcGIS案例学习笔记2_2 联系方式:谢老师,135_4855_4328,xiexiaokui#qq.com 时间:第二天下午 2018年8月12日 案例1:模型构建器,山顶点提取 背景:数据量大 ...

  5. Mysql 多个字段查找重复数

    delete FROM `test_table` WHERE id in (SELECT id,concat(user_id,user_id2) as __fFROM `test_table` whe ...

  6. auto semicolon insertion 自动分号补齐的坑

    今天发现js自动分号补齐的坑,来看如下两段代码: function Hello(){ return { name: ’JavaScript’ }; } alert(Hello()); //输出unde ...

  7. linux下mongodb授权登录

    mongodb版本为3.2(目前最新),演示的是linux下的mongodb授权认证 第一次登录不启动授权(mongo默认不启动) ./mongod --dbpath=/home/db/data -- ...

  8. ftp上传下载工具类

    package com.taotao.utils; import java.io.File; import java.io.FileInputStream; import java.io.FileNo ...

  9. bootstrap下拉框的例子,提示Error: Bootstrap's JavaScript requires jQuery

    bootstrap很多js依赖jquery,所以需要引入jquery   遇到的问题: 页面访问提示:Error: Bootstrap's JavaScript requires jQuery   解 ...

  10. java并发:AQS的简单理解

    简介: AQS全称 AbstractQueuedSynchronizer,提供了一个基于FIFO(先进先出)队列,可以用于构建锁或者其他相关同步装置的基础框架. ReentrantLock.Semap ...