2010-09-02 29 views
1

即時嘗試使用swfupload在我的網站上,並遵循所有的指示骨頭。現在,當我選擇一個文件時,所有我看到的都是掛起......它永遠不會進一步。這裏是我的實現SWFUPLOAD卡在待定

var swfu = new SWFUpload({ 
    upload_url : "urtupload.php", 
    flash_url : "swfupload/swfupload.swf", 
    flash9_url : "swfupload/swfupload_fp9.swf", 
     post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"}, 
     file_size_limit : "100 MB", 
     file_types : "*.zip;*.arj;*.rar;*.tar.gz;*.tgz", 
     file_types_description : "All Files", 
     file_upload_limit : 100, 
     file_queue_limit : 1, 
     file_post_name : "Filedata", 
     custom_settings : { 
      progressTarget : "fsUploadProgress", 
      cancelButtonId : "btnCancel" 
     }, 
     debug:false, 
     // Button settings 
     button_image_url: "images/ub.png", 
     button_width: "61", 
     button_height: "22", 
     button_placeholder_id: "spanButtonPlaceHolder", 
     button_text_style: ".theFont { font-size: 16; }", 
     button_text_left_padding: 12, 
     button_text_top_padding: 3, 
     moving_average_history_size: 40, 

     // The event handler functions are defined in handlers.js 
     // The event handler functions are defined in handlers.js 
     swfupload_preload_handler : preLoad, 
     swfupload_load_failed_handler : loadFailed, 
     file_queued_handler : fileQueued, 
     file_queue_error_handler : fileQueueError, 
     file_dialog_complete_handler : fileDialogComplete, 
     upload_start_handler : uploadStart, 
     upload_progress_handler : uploadProgress, 
     upload_error_handler : uploadError, 
     upload_success_handler : uploadSuccess, 
     upload_complete_handler : uploadComplete, 
     queue_complete_handler : queueComplete 
    }); 
+0

你可以發佈你的fileQueued和uploadError函數嗎? – 2010-09-21 20:00:03

回答

2
在你的方法

fileDialogComplete(),請確保您有使用Javascript:

this.swfupload('startUpload'); 

這會告訴你SWFU實例開始上傳。

如果您使用的示例代碼(看起來像你可能),一定要還使用/包括文件「handlers.js」(http://demo.swfupload.org/v220/simpledemo/js/handlers.js

祝你好運!

0

我在將我的取消按鈕變爲.NET控件後出現此問題。由於.NET重命名了該控件,因此在fileDialogComplete中產生了一個錯誤,並且從未調用startUpload。它位於try/catch塊中,所以它默默地失敗。

0

這是關於swfupload元素在隱藏div!正如我在這裏所瞭解的:swfupload sometimes stuck on "Pending..."

大多數情況下,它與.NET或缺少的startUpload()調用無關(因爲後者在任何示例中都是非常標準的函數)。

0

你必須有一些id或類缺少你用於造型。因爲我遇到了同樣的問題,當我修正了進度條,按鈕等給出的ID和類時,我修正了相同的問題:

0

Flash Player 10:因爲Flash Player 10需要SWFUpload SWF才能操作,爲了加載可見。如果button_placeholder_id設置爲隱藏的元素(可見性設置爲隱藏或顯示設置爲無),SWFUpload將無法加載。