Re: How can I update $uploader->UploadUrl="../php/cmds/PHPFileUploadCmd.php" after Page Load then after ajax resulthandler?

  •  03-05-2012, 8:34 PM

    Re: How can I update $uploader->UploadUrl="../php/cmds/PHPFileUploadCmd.php" after Page Load then after ajax resulthandler?

    I solved it by myself eventually.
     
    Just at the resultHandler after Ajax post. change it with JQuery. The javascript id of the phpFileUploader button is "myuploader_Loader_unique". So that I can change it with simple JQuery script as follows:
     
    function insertAlbumResultHandler(res){

        //alert(res);
        var obj = JSON.parse(res);
        if (obj.albums[0].sid > 0)
        {
            $('#myuploader_Loader_unique').attr("uploadurl", "../php/cmds/PhpFileUploadCmd.php?albumSid=" + obj.albums[0].sid);
            $('#publishBtn').removeAttr("disabled");
            
            $("#albumTable .sid").val(obj.albums[0].sid);
            //uploadurl += "?albumSid=" + obj.albums[0].sid;
              disableAlbumControls(false);
              $('#submitAlbumBtn').fadeOut(3000, function(){
                  $(".submitAlbumTr").css("display", "none");
                  $('#submitAlbumBtn').css("display", "none");
              });
            $('#uploadBtn').fadeIn(3000, function() {
                // Animation complete
            });
        } // end if (obj.album[0].sid > 0)
        else
        {
            alert(res);
        } // end if (obj.album[0].sid > 0) ... else
    } // end showResult 
     
     
    Man Pak Hong, Dave
    manpakhong
    manpakhong@hotmail.com

    Man Pak Hong, Dave
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems