2010-12-04 14 views
0

我想做出一個上傳SISTEM,這裏是代碼uploadify,裏面插入.uploadifyQueueItem一些HTML

 jQuery("#file_upload").uploadify({ 
     'uploader'  : domain+'/swf/uploadify.swf', 
     'expressInstall': domain+"/swf/expressInstall.swf",       
     'script'   : domain+'/upload.php', 
     'cancelImg'  : domain+'/images/cancel.png', 
     'buttonImg' : domain+'/images/upload_button.png', 
     'width': '265', 
     'height': '27',    
     'wmode': 'transparent', 
     'folder'   : '/uploaded_files', 
     'sizeLimit'  : 1024*1024*10, 
     'scriptData': {'PHPSESSID': session_id }, 
     'fileExt': allowed_ext, 
     'fileDesc': allowed_ext, 
     'removeCompleted' : false, 
     'auto' : false, 
     'multi' : false, 
     'onSelect' : function(event,ID,fileObj) { 
      var type_ext=fileObj.type.substr(1); 
      if(extfile[type_ext]!='undefined'){ 
       var url_name='<?php echo $image_dir ?>/'+extfile[type_ext]+'.png' 
       console.log(url_name); 
       jQuery('.uploadifyQueueItem').append('some html'); 


      } 
     } 
    }); 

我需要.uploadifyQueueItem圖像內插,但不工作,我認爲jQuery('.uploadifyQueueItem').append('some html');.uploadifyQueueItem被創建之前發生了火災,我沒有找到可以幫助我解決這個問題的事件,有可能解決朋友嗎?大感謝您的幫助,和對不起我的英語不好

回答

0

在你需要的內部.uploadifyQueueItem插入,一旦某一項選擇在這個過程中有什麼意義呢?

根據來自uploadify docs的事件數量,應該有一個事件來處理您需要的事件。我建議嘗試使用onSelectOnce()事件,每次將文件或文件組添加到隊列時會觸發該事件。

除此之外,如果你想顯示已上傳的圖片,你可能要提出,在這樣一個獨立的事件爲onComplete()