1
我已經看到其他人如何捕捉從其上傳器後端返回的數據。 (請參閱:How do i get swfupload to return image URL after upload?)但是我不斷收到.bind()的javascript錯誤。有任何想法嗎?SWFupload url callback
代碼:
upload1 =新的SWFUpload({
// Backend Settings
upload_url: "uploader2.py",
post_params: various params,
// File Upload Settings <a id="printimages" style="float: right">Print Images</a>
file_size_limit : "100 MB", // 100MB
file_types : "",
file_types_description : "Any File",
file_upload_limit : 1000,
file_queue_limit : 0,
// Event Handler Settings (all my handlers are in the Handler.js file)
swfupload_preload_handler : preLoad,
swfupload_load_failed_handler : loadFailed,
file_dialog_start_handler : fileDialogStart,
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,
// Button Settings
button_image_url : "images/XPButtonUploadText_61x22.png",
button_placeholder_id : "ButtonPlaceholder1",
//button_placeholder : "spanButtonPlaceholder1",
button_width: 61,
button_height: 22,
moving_average_history_size: 1,
// Flash Settings
flash_url : "swf/swfupload.swf",
flash9_url : "swf/swfupload_fp9.swf",
// My settings
custom_settings : {
progressTarget : "fsUploadProgress1",
cancelButtonId : "btnCancel1",
tdFilesQueued : document.getElementById("tdFilesQueued"),
tdFilesUploaded : document.getElementById("tdFilesUploaded"),
tdErrors : document.getElementById("tdErrors"),
tdCurrentSpeed : document.getElementById("tdCurrentSpeed"),
tdCurrentFile : document.getElementById("tdCurrentFile"),
tdAverageSpeed : document.getElementById("tdAverageSpeed"),
tdMovingAverageSpeed : document.getElementById("tdMovingAverageSpeed"),
tdTimeRemaining : document.getElementById("tdTimeRemaining"),
tdTimeElapsed : document.getElementById("tdTimeElapsed"),
tdPercentUploaded : document.getElementById("tdPercentUploaded"),
tdSizeUploaded : document.getElementById("tdSizeUploaded"),
tdProgressEventCount : document.getElementById("tdProgressEventCount")
},
// Debug Settings
debug: false
}).bind('uploadSuccess', function(event, file, serverData){
alert(serverData);
});