Howdy, Stranger!

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

v2 uploadifySettings Problem
  • Hello,

    I think there is a bug related with uploadifySettings in v2.

    Here is the sample code. If there is one more than uploadify object in a page, initial parameters which is being set by scriptData in uploadify function is not working properly.

    For example , in the code as shown below clicking "Start 1" object should send prm value hello and clicking "Start 2" should send world. But when i check context.Request.Form["type"] value in server side , both requests have same results "world".

    Interesting issue that when commented uploadifySettings line , all things are working properly.

    In my opinion uploadifySettings function is overwriting initialized parameters

     
    <script type=\"text/javascript\">

    $(function() {
    setupload(\"upload1\",\"hello\");
    setupload(\"upload2\",\"world\");

    });

    function start(obj) {
    $('#' + obj).uploadifySettings(\"scriptData\", {'uid': (new Date()).getTime()});
    $('#' + obj).uploadifyUpload();
    }

    function setupload(obj,prm) {
    $(\"#\" + obj).uploadify({
    'uploader': 'media/uploader/uploadify.swf',
    'buttonText' : \"text\",
    'cancelImg': 'media/uploader/cancel.png',
    'folder': 'upload',
    'script': 'upload.ashx',
    'fileExt': '*.jpg;*.gif;*.png',
    'fileDesc': 'Images',
    'sizeLimit': '1024000',
    'scriptData': { 'prm': prm },
    'auto': false,
    'multi':true,
    'simUploadLimit':3,
    'width': 110,
    'height': 32
    });
    }
    </script>
    <input type=\"file\" id=\"upload1\" />
    <a href=\"javascript:start('upload1')\">Start 1</a>
    <br />
    <br />
    <br />
    <input type=\"file\" id=\"upload2\" />
    <a href=\"javascript:start('upload2')\">Start 2</a>


    Any comments ?

    Thanks
    Tep
  • I have never tried setting up uploadify as you have here, but to test what is set in the scriptData you can obtain the object with

    $('#someID').uploadifySettings('scriptData');

    It will return the object exactly as it is held in flash. Certainly your code should have two items in the scriptData object: uid and prm. If you print the contents of the object you should see two items.
  • i tested the script as you mentioned above and think that %99 there is a problem with setting scriptdata via uploadifySettings.

    first alert shows hello and then null for first object for id = upload1

    then running uploadifySettings

    and when i check same object again second alert shows "world" not hello, must be hello because nothing changed except running function


    function start(obj) {
    var tmp = $('#' + obj).uploadifySettings('scriptData');
    alert(tmp.prm);
    alert(tmp.uid);
    $('#' + obj).uploadifySettings(\"scriptData\", {'uid': (new Date()).getTime()});
    tmp = $('#' + obj).uploadifySettings('scriptData');
    alert(tmp.prm);
    alert(tmp.uid);
    $('#' + obj).uploadifyUpload();
    }


    please put the script any html you will get same results ...
  • What I'm seeing is that it's not localising the settings to the requested element. The plugin appears to be putting the options into global space, which is why when you are using two or more uploadify's with scriptData it is picking up the last stored value in scriptData.

    I see running two uploadify's on one page a pointless exercise and as such I never test the functionality with multiple uploadify's. uploadifySettings works perfectly with one uploadify. Multiple uploadify's are the demo page to demonstrate the different setups possible.

    That said, it is still obviously a problem for users and we will need to fix it for those that wish to use multiple uploadify's on the same page.

    Thank you for bringing to our attention
  • This is still not fixed. :=(