简体   繁体   English

拖放上传在IE中不起作用

[英]Drag and Drop upload not working in IE

In my website for uploading image to server, i am using HTML5 Drag and Drop method of upload. 在用于将图像上传到服务器的网站中,我使用的是HTML5拖放方法。

I am using mfupload.js opensource script. 我正在使用mfupload.js开源脚本。 It is working for all browsers except IE. 它适用于除IE之外的所有浏览器。

Please give me idea how to make it work this in IE or Please provide good script for IE. 请让我知道如何使其在IE中起作用,或者请为IE提供良好的脚本。

Note: Drag and Drop means Drag from folder and drop into webpage. 注意:“拖放”是指从文件夹拖放到网页中。

Script: 脚本:

    <script src="js/mfupload.js" type="text/javascript"></script>
<script type="text/javascript">

$().ready(function() {

    var errors="";

    $('#upload').mfupload({

        type        : 'jpeg,jpg,png,gif,mp3,aac,aif,aiff,m4a,wav,mp4,ogg,webm,mov,m4v,3gp,3g2,m2v,avi', //all types
        maxsize     : 20,
        post_upload : "./upload.php",
        folder      : "./file/pic/uploaded_files",
        ini_text    : "Drop your photo,video or audio here",
        over_text   : "Drag your file(photo,video or audio) (max-size: 20MB each)",
        over_col    : 'gray',
        over_bkcol  : 'white',

        init        : function(){       
            $("#uploaded").empty();
        },

        start       : function(result){ 
            pop_uploading();
            $("#uploaded").append("<div id='FILE"+result.fileno+"' class='files'>"+result.filename+"<div id='PRO"+result.fileno+"' class='progress'></div></div>"); 
        },

        loaded      : function(result){
            $("#PRO"+result.fileno).remove();
            $("#FILE"+result.fileno).html("Uploaded: "+result.filename+" ("+result.size+")");
        },

        progress    : function(result){
            $("#PRO"+result.fileno).css("width", result.perc+"%");
        },

        error       : function(error){
            errors += error.filename+": "+error.err_des+"\n";
        },

        completed   : function(){
            if (errors != "") {
                alert(errors);
                errors = "";
            }
        }
    });     
})
</script>

Thanks in Advance..... 提前致谢.....

It's wrote on the mfupload.js documentation : 它写在mfupload.js文档中

Compatible with Internet Explorer ( < v.10 ) but no Drag and Drop support, single file upload and Server-side validation. 与Internet Explorer(<v.10)兼容,但不支持拖放,单个文件上传和服务器端验证。

So I guess, either your will have to edit the library, either you can use another one, like Plupload 所以我想,要么您将不得不编辑库,要么可以使用另一个库,例如Plupload

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM