0

having "issues" with the blueimp jquery file uploader, uploads fine, but no progress is reported back to the calling page, only in ie8/ie9.

"done" seems to work properly, its only the "progress" part that isnt working, anyone any ideas?

<script>
    $(function () {

        $('#video').fileupload({
             forceIframeTransport: true,
            dataType: 'json',
            done: function (e, data) {
                $.each(data.result, function (index, file) {
                    $('button').removeAttr('disabled');
                    alert(file);
                    $('input#upload_video').val(file.name);
                    $('p#filename').text(file.name+ ' Uploaded');
                    $('input#video').remove();

                    alert( $('input#upload_video').val());

                });
            },

            progress: function (e, data) {

                var progress = parseInt(data.loaded / data.total * 100, 10);
                $('p#filename').text('Please wait...' +progress + '%');
            },

            start: function (e) {
                // alert('Uploads started');
            },

            stop: function (e) {
                // alert('Uploads finished');
            },

            fail: function (e, data) {
                alert('Your video could not be uploaded');
                $('p#filename').text('');
            }

        });
    });
</script>
4

3 回答 3

2

我不认为你做错了什么。目前 IE 不支持它。见https://github.com/blueimp/jQuery-File-Upload/issues/1369

于 2012-08-03T15:14:08.147 回答
1

IE9 不支持 XMLHttpRequest 级别 2,因此您将无法使用 IE < 10 进行工作。它没有与插件相关的任何内容。

http://caniuse.com/xhr2

于 2013-04-10T13:46:31.123 回答
-3
    $("#txt1").fileupload({
        replaceFileInput: false,
        dataType: "json",        
        datatype:"json",
        url: "<%=Page.ResolveUrl("~/WebService/AddAttachment.ashx")%>",
        done: function (e, data) {
            $.each(data.result, function (index, value) {
         //You get the response data in here from your web service
            })
            $("#txt1").val("");
        }`enter code here`
    });

这在 IE8 和 IE9 + 以上都经过测试并且工作正常。请确保使用正确的dataType:“json”(或datatype:“json”),并确保在调试和检查时您的Web服务方法响应正确更新为data.result。谢谢

于 2013-10-11T06:14:56.283 回答