开发者

SWFUpload: How to cancel an upload in Classic Form

开发者 https://www.devze.com 2023-01-10 08:19 出处:网络
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)

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_hand开发者_高级运维ler : 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消