Search code examples
javascriptjqueryuploadifyscriptdata

uploadify changing scriptData


when i call uploadifySettings("scriptData", { 'description': description });

it mean that param description is set one time after click button upload, how can i set param description on each file that uploads ? for example i want to upload 10 files so i can change param description 10 times


Solution

  • Check out the documentation: http://www.uploadify.com/documentation/

    You could use the onComplete event to change the settings

      $('#fileInput').uploadify({
        'uploader'  : 'uploadify.swf',
        'script'    : 'uploadify.php',
        'cancelImg' : 'cancel.png',
        'auto'      : true,
        'folder'    : '/uploads'.
        'onComplete': function() {
                         // do whatever logic to change the description
                         var descr = ""; // <- cool logic goes here
                         // change scriptData
                         $('$fileInput').uploadifySettings("scriptData", {'description': descr });
                     }
       });