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

标签 php javascript swfupload

我正在使用经典表单演示。链接为:link text

如果您尝试演示并尝试上传文件,您可以看到,一旦单击“提交申请”按钮,取消(十字图像)按钮不会出现在蓝色的右上角框(指示进度)。如何操作现有代码以便能够在上传过程中看到取消按钮并取消上传?

当前的 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> 

谢谢。

最佳答案

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

关于php - SWFUpload:如何取消经典表单的上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3387238/

相关文章:

PHP PDO - 连接过多时显示密码

javascript - 如何在 jquery 中将 2 个按钮合并为 1 个按钮

SWF上传IO错误

javascript - Uploadify 无法读取属性 'queueData'

php - 如何组合两个 MySQL 查询,其中一个查询在另一个 while 循环中定义?

php - 将 PHP 代码写入文件

javascript - 需要访问 Vue.js 中的数据元素

flash - 上传文件时,flash是否总是发布“Filename”参数?

php - 从 PHP 生成 Javascript?

javascript - 当你有来自后端的参数时,如何使用不显眼的 JavaScript?