Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Uploadify stops working in IE
  • Hi all,

    Here's a problem. I'm using Uploadify 2.1.0 on my page. When I run it in Firefox or Chrome it works OK, but when I run it in IE8 the upload does not start at all and IE8 throws a following message:
    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Timestamp: Tue, 16 Feb 2010 19:30:00 UTC

    Message: Object doesn't support this property or method
    Line: 244
    Char: 5
    Code: 0
    URI: http://localhost:3328/Scripts/Plugins/U ... .v2.1.0.js


    The referenced line of code in jquery.uploadify.v2.1.0.js is the following:
    document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);


    Anybody has any idea why this is happening?

    Any help much appreciated.

    Dragan B.
  • Here's an update from more testing. I tested the same page on Opera 9.64 and if fails with the same message, only Opera provides more elaborate description of it.

    The line that creates problems is above mentioned:
    document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);


    Opera says the following:
    message: Statement on line 244: Type mismatch (usually non-object value supplied where object required)


    Now this is in my opinion indication of issues between Uploadify and jQuery. I am using jQuery version 1.3.2, don't know if it matters, it shouldn't in my oppinion.
  • OK, figured out it myself. We had the Uploadify inside of jQuery dialog, and since jQuery UI dialog is instantiated on-the-fly by jQuery it does not sit in DOM properly so it crashes. As soon as we placed Uploadify in plain and simple div it started working properly on all browsers. So people, my advice to you is: use that Firebug as much as you can, it is your best friend in the dark world out there.

    Now the only problem we have is a dreaded I/O #2038 error. This can apparently mean anything but it is amazing that nobody came with proper solution for IIS, I could only see some people that had it working under Apache. If anybody has any suggestions on how to handle this error in IIS 7 with default app pool and 'Forms' authentication, I would be very much grateful.
  • Hi DraganB,

    You are probably correct. However, there is a solution if you want to use uploadify in a dialog like I do. All you have to do is create your dialog first in for example a $(document).ready(function() { function and then uploadify. This seems to work for me and I can now use uploadify in a JQuery dialog in both FF and IE8. I have not tried other browsers yet.

    Firebug rules,

    Gummi Kalli
  • to gummikalli:
    it works after using your method.
    I registered just to say thanks to you!!!!!!
    really strongly!
  • to gummikalli:
    I also registered just to say thanks.
    Simply move .dialog('open') before .uploadify(...)
    Subtle, yet profound. Thanks
  • After all my excitement, there was yet one more problem.
    After closing the dialog, when opening it again, the same problem returned.
    I guess every time the dialog is opened it rebuilds the DOM in the way DragonB explained.
    This creates the issue where IE cannot make the function calls from the flash object.
    To resolve that issue, I only defined the div container for the button in the original code for my dialog. I also do not call the uploadify init in my onload, only the dialog init.
    Then, in your code that opens the popup, first assign the html for your upload button inside your div, then call the uploadify init. Then you can open your dialog with a fresh version of the uploadify that IE can recognize in the dom.

    Example of HTML page:

    <input type="button" value="Open Photo Dialog" onclick="DialogOpen()" />
    ....
    <div id="dialogUpload">
    ...
    <div id="uploadButtonContainer"></div>
    ...
    </div>


    Example of js file:

    // Open Dialog Window
    function DialogOpen() {
    var buttonText = '<input type="button" id="uploadButton" value="Choose Photos" />';
    $("#uploadButtonContainer").html(buttonText);
    $("#uploadButton").uploadify({...});
    $("#dialogUpload").dialog("open");
    }

    // onload events
    $(function () {
    $("#dialogUpload").dialog({....});
    }


    That seemed to do the trick for me. Otherwise you may want to open the dialog first, then apply the html and uploadify. Also, remember when closing the dialog you will want to uploadifyClearQueue, since the new uploadify button doesnt know about the old items. Otherwise you can put your entire html for the popup on each load to prevent the old queue from showing.
  • The user and all related content has been deleted.