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

时间:2010-08-02 11:25:28

标签: 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> 

谢谢。

1 个答案:

答案 0 :(得分:0)

通过点击按钮或其他方式调用swfu方法cancelUploadref)。