SWFUpload:如何取消经典表单的上传

发布于 2024-09-12 14:52:34 字数 1695 浏览 2 评论 0原文

我正在使用经典表单演示。链接是:链接文本

尝试上传文件,可以看到点击“提交申请”按钮后,右上角的蓝色框(指示进度)中没有出现取消(十字图像)按钮。我如何操作现有代码才能看到取消按钮和取消按钮?在上传过程中取消上传吗?

当前的JS代码是:

<script type="text/javascript"> 
  var swfu;

  window.onload = function () {
   swfu = new SWFUpload({
    // Backend settings
    upload_url: "upload.php",
    file_post_name: "resume_file",

    // Flash file settings
    file_size_limit : "10 MB",
    file_types : "*.*",   // or you could use something like: "*.doc;*.wpd;*.pdf",
    file_types_description : "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 : "XPButtonUploadText_61x22.png",
    button_placeholder_id : "spanButtonPlaceholder",
    button_width: 61,
    button_height: 22,

    // Flash Settings
    flash_url : "../swfupload/swfupload.swf",

    custom_settings : {
     progress_target : "fsUploadProgress",
     upload_successful : false
    },

    // Debug settings
    debug: false
   });

  };
 </script> 

谢谢。

I am using the classic form demo. The link is: link text

If you try out the demo & try to upload a file, you can see once you click on the "Submit Application" button, the cancel (cross image) button does not show up in the top right hand corner of the blue box (that indicates the progress). How can I manipulate the existing code to be able to see the cancel button & cancel the upload while it is in progress?

Current JS code is:

<script type="text/javascript"> 
  var swfu;

  window.onload = function () {
   swfu = new SWFUpload({
    // Backend settings
    upload_url: "upload.php",
    file_post_name: "resume_file",

    // Flash file settings
    file_size_limit : "10 MB",
    file_types : "*.*",   // or you could use something like: "*.doc;*.wpd;*.pdf",
    file_types_description : "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 : "XPButtonUploadText_61x22.png",
    button_placeholder_id : "spanButtonPlaceholder",
    button_width: 61,
    button_height: 22,

    // Flash Settings
    flash_url : "../swfupload/swfupload.swf",

    custom_settings : {
     progress_target : "fsUploadProgress",
     upload_successful : false
    },

    // Debug settings
    debug: false
   });

  };
 </script> 

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧人九事 2024-09-19 14:52:34

调用 swfu 方法 cancelUpload (ref )通过单击按钮或其他方式。

Call swfu method cancelUpload (ref) from a button click or something.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文