我正在使用swfupload,并希望通知用户他们需要安装Flash才能使用。
我发现了这个:http://swfupload.org/forum/generaldiscussion/2140虽然不知道我需要在哪里实现它。
这是我的代码:
<script type="text/javascript">
var upload0, upload1, upload2, upload3, upload4, upload5;
window.onload = function () {
upload{$smarty.section.r.index} = new SWFUpload({
// Backend settings
upload_url: "{$REQUEST_URL}{if $swfcallbackid}/id/{$swfcallbackid}{/if}?swfcb={$row.formname}&{php}echo session_name();{/php}={php}echo session_id();{/php}",
file_post_name: "{$row.formname}",
post_params: {"{php}echo session_name();{/php}" : "{php}echo session_id();{/php}"},
// Flash file settings
file_size_limit : "500MB",
file_types : "{$row.mask|default:"*"}", // valid file type mask
file_types_description : "{$row.mask_desc|default:"All Files"}",
file_upload_limit : "0",
file_queue_limit : "1",
// Event handler settings
//swfupload_loaded_handler : swfUploadLoaded,
file_dialog_start_handler: fileDialogStart,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
//upload_start_handler : uploadStart, // I could do some client/JavaScript validation here, but I don't need to.
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
// Button Settings
button_image_url : "{$HOME}/webapp/shared/swfupload/XPButtonUploadText_61x22.jpg",
button_placeholder_id : "{$row.formname}_button",
button_width: 63,
button_height: 23,
button_window_mode: "TRANSPARENT",
// Flash Settings
flash_url : "/webapp/shared/swfupload/Flash/swfupload.swf",
custom_settings : {
progressTarget : "{$row.formname}_progress",
cancelButtonId : "{$row.formname}_cancel",
filenameDisplayId : "{$row.formname}"
},
// Debug settings
debug: false
});
}
</script>