Howdy, Stranger!

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

uloadifyUpload() showing error
  • I am having some problems with the uploadifyUpload() function. I have a 3 step form, the uploadify plugin is on the second step, so one hits browse and selects a file but it doesn;t upload yuntil they click submit on the 3rd step.

    my uploadify input is :
    <input id=\"fileInput\" name=\"fileInput\" type=\"file\" />


    it calls the uploadify script fine and I can select a file. If I immediately upload the file it works. But if I try to start the upload on the 3rd step by using
    $(\"#fileInput\").uploadifyUpload();


    I get an error on line 242 of the uploadify.js.
    		
    uploadifyUpload:function(ID) {
    jQuery(this).each(function() {
    document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);
    });


    It can't seem to find that ID. and maybe I am just doing it wrong, but I can;t find good documentation on this.
  • Hi,
    i answered to another topic that may be the same problem as yours, so i copy/paste the answer ( i'm lazy i know :) )

    If it doesn't help you, tell us what is the first and third steps.
    <<<br />i don't know if you still have this problem but i think i've found the solution for my problem, and it seems to be the same as yours.
    The fact is that IE works bad with flash and jQuery dialog, flash files moving are not appreciate in our M$ wonderful browser...

    The tip to make it work, is always to generate the dialog box before the flash files ( so before your uploadify instance ).

    so instead of doing :

    $(x).uploadify(....);
    $(y).dialog(...);

    you need to do this:
    $(y).dialog(...);
    $(x).uploadify(....);

    So that he generates the container ( the dialg box ) then he makes the flash work ( instead of putting it in after )
    >>
  • Hi,

    I'm getting the same error as the original poster, but I'm not using a dialog. Everything in the page is loaded and static. My code looks like this:

    $(container).find(\".uploaderOverlay\").uploadify({
    'uploader' : 'javascript/uploadify/uploadify.swf',
    'script' : '../handlers/UploadImage.ashx',
    'fileDesc' : 'Image files',
    'fileExt' : '*.jpg;*.jpeg;*.gif;*.png',
    'cancelImg' : 'javascript/uploadify/cancel.png',
    'buttonImg' : '../controls/canvas/img/btn-uploader-browse.png',
    'height' : 23,
    'width' : 74,
    'onSelect' : function() {
    var upload = $(container).find(\".uploadLink\");
    $(upload).show();
    $(upload).click(function(e){
    e.preventDefault();
    $(container).find(\".uploaderOverlay\").uploadifyUpload();
    });
    $(container).find(\"object\").hide();
    }


    I hide the Upload button until the file is selected and then show and enable it. Here's the markup:

    <input type=\"file\" id=\"abUploader3371_overlay\" class=\"uploaderOverlay\" />
    <a class=\"uploadLink btnNormal\" href=\"#\"><span>Upload</span></a>


    When I click the Upload button, I get the error "document.getElementById(a(this).attr("id") + "Uploader").startFileUpload is not a function". Same thing happens when I click the default cancel button (only with the cancel upload function). Can you see anything I might be doing wrong?

    Thanks!
    Garann

    Update: Maybe this is a common newbie mistake.. I realized that the problem was caused by hiding the Flash object. I'm resizing it to 1px and it works now.