我正在尝试在我的网站上使用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
});发布于 2010-09-12 03:26:34
在你的方法:fileDialogComplete()中,确保你有:
this.swfupload('startUpload');这将告诉您的SWFU实例开始上传。
如果您正在使用示例代码(看起来可能是这样),请确保还使用/包含文件'handlers.js‘(http://demo.swfupload.org/v220/simpledemo/js/handlers.js)
祝好运!
发布于 2011-11-25 08:54:36
在将cancel按钮变成.NET控件后,我遇到了这个问题。因为.NET重命名了该控件,所以在fileDialogComplete中生成了一个错误,并且从未调用过startUpload。它在try/catch块中,所以它会静默地失败。
发布于 2012-03-07 20:37:22
它是关于swfupload元素在一个隐藏的div中!我在这里了解到:swfupload sometimes stuck on "Pending..."
大多数情况下,它与.NET或缺少的startUpload()调用无关(因为后者在任何示例中都是一个非常标准的函数)。
https://stackoverflow.com/questions/3630676
复制相似问题