jquery file upload is not working on IE 7,8,9

659 views
Skip to first unread message

Sangbum Kim

unread,
Jul 10, 2013, 11:30:22 AM7/10/13
to jquery-f...@googlegroups.com
Hello, 

I'm developing a website using Jquery File Upload.
Until now, i've tested this api(script) in my website.
In my opinion, it's not working well on IE 7+.
Chrome, Safari and others is working well.

So, i need your help.
I got a error message.
"Access denied (jquery.js - line 3241)"

1. My script part

    $('#upload').fileupload({

        dataType: 'json',

        add: function (e, data) {

//             data.context = $('<p/>').text('Uploading...').appendTo(document.body);

            data.submit();

        },        

        success: function (e, data) {

    alert("test1");

    $("#member_image_file").empty();                

        $('#member_image_file').append("<a href=\""+e.imgUrl+"\">"+e.filename+"</a>");

$("#member_image").val(e.imgUrl);

$("#member_image_url").val(e.imgUrl);

$("#img_member_image").attr("src", e.imgUrl);

$("#img_member_image").show();

        },

        error: function (e, data) {

    $("#member_image_file").empty();        

$('#member_image_file').append("<font color=red>file type should not be Binary file or file size should be under 3M bytes.</font>");     

        },                

    progressall: function (e, data) {

        var progress = parseInt(data.loaded / data.total * 100, 10);

        $('#progress .bar').css(

            'width',

            progress + '%'

        );

    }

    });

    $("#attach").click(function () {

    alert("test");

    $("#upload").trigger('click');

});


2. Html part

<dd class="join_01_2"  style="text-align:left;width:68%;">

<br></br>

<a href='#;return false' id='attach'>[<spring:message code="setting.fileselect"/>]</a> &nbsp;&nbsp;<span id='member_image_file'></span><br/>                                                                                                         

<input id="upload" type="file" name="file" data-url="/${sessionScope.user.user_id}/common/imageUpload.json" multiple style="opacity: 0; filter:alpha(opacity: 0); width:60%;">

</input>


<div id="progress">

    <div class="bar" style="width: 0%;"></div>

</div>

</dd> 


Thanks in advance.

Brian.

Matt Treagus

unread,
Jul 11, 2013, 11:52:21 AM7/11/13
to jquery-f...@googlegroups.com
Hey,

There some permission restrictions in IE that stop you being able to use anything but the label as the area for the user to click on.

Change the A tag (id: attach) to be the label for the input field and then just style the label instead.

Hope this helps

Sangbum Kim

unread,
Jul 11, 2013, 1:14:25 PM7/11/13
to jquery-f...@googlegroups.com
Hello,

I changed HTML part a little according to your guide.

<label for="upload">[<spring:message code="setting.fileselect"/>]</label>                                                                                                         

<input id="upload" type="file" name="file" data-url="/${sessionScope.user.user_id}/common/imageUpload.json" multiple style="opacity: 0; filter:alpha(opacity: 0); width:60%;">

</input>


But i got some error.
As i think, no file(data) is sent to Server.
Reply all
Reply to author
Forward
0 new messages