Search code examples
phpjqueryuploadify

Jquery uploadify plugin


I kept one jquery uploadify plugin on page and one <img> tag besides it. Everything works fine as expected except one problem. I want to update <img> to show the new image as soon as some image is uploaded. How can i do this? I am using Php.

Thanks in advance :)


Solution

  • You can use onComplete callback (http://www.uploadify.com/documentation/).

    Usage sample is here:

    $(document).ready(function() {
      $('#fileInput').uploadify({
        'uploader'  : 'uploadify.swf',
        'script'    : 'uploadify.php',
        'cancelImg' : 'cancel.png',
        'auto'      : true,
        'folder'    : '/uploads'
    
        /* ====== HERE ===== */
        'onComplete': function(event, queueID, fileObj, response, data) {       
            $("#my_image").attr("src","your path");
         }
    
      });
    });
    

    (http://www.uploadify.com/implementation/)