swfupload 上傳失敗求解解決思路
來源:互聯網
上載者:User
swfupload 上傳失敗求解
if ( empty( $Filedata ) || !is_uploaded_file( $Filedata ) )
{
echo "ERROR: Upload Error! ";
exit( 0 );
}
老是卡在這個位置 擷取不到filedata的值
window.onload = function ()
{
swfu = new SWFUpload(
{
// Backend Settings
upload_url: "swfuploadvideo.php",
post_params: {"PHPSESSID": "", "dopost" : "","utype":"shangjia"},
// File Upload Settings
file_size_limit : "500 MB",// 2MB
file_types : "*.flv",
file_types_description : "選擇 flv 格式視頻",
file_upload_limit : "1",
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
button_image_url : "img/SmallSpyGlassWithTransperancy_17x18.png",
button_placeholder_id : "spanButtonPlaceholder",
button_width: 250,
button_height: 18,
button_text : '選擇本地視頻 (視頻最大為 500 MB,支援多選)',
button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
button_text_top_padding: 0,
button_text_left_padding: 18,
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,
// Flash Settings
flash_url : "../images/swfupload/swfupload.swf",
custom_settings : {
upload_target : "divFileProgressContainer",
thumbnails_target:"thumbnails"
},
// Debug Settings
debug: true
});
};
------解決方案--------------------
資訊太少。無法判斷。
------解決方案--------------------
既然,提示“$Filedata”擷取不到,在往上面的代碼找原因,是啥時候給$Filedata賦值,慢慢向上分析,看看
------解決方案--------------------
upload1 = new SWFUpload({ ..... file_post_name : "Filedata", .......});
是不是這個屬性的事,檔案資料的發送名稱。
這個如果不一致,的確是獲得不到檔案資料和資訊的。
php部分 需要通過$_FILES["Filedata"]來擷取資料
問題應該出在這部分了