Cancel All Button

Last post 07-12-2010, 3:20 PM by Eric. 3 replies.
Sort Posts: Previous Next
  •  06-24-2010, 3:12 PM 61989

    Cancel All Button

    Is There a way to change the "Cancel All" button like the "Cancel" Button?
  •  06-24-2010, 4:29 PM 61990 in reply to 61989

    Re: Cancel All Button

    Please try the following code:

    <% @ Language="VBScript" %>  
    <!--Step 1: Register Uploader to your page -->  
    <!-- #include file="aspuploader/include_aspuploader.asp" -->  
    <html>   
    <body>   
            <form id="form1" method="POST">   
                <%
                    Dim uploader   
                    Set uploader=new AspUploader   
                    uploader.Name="myuploader"
                    uploader.CancelAllMsg="Cancel all Uploads"
                    uploader.Render()  
                %>
            </form>   
    </body>   
    </html>

    Regards,
    Eric
  •  06-25-2010, 8:23 AM 61999 in reply to 61990

    Re: Cancel All Button

    I'm sorry what I meant was is there a way to use my own button for the "Cancel All" Like the Cancel button
    1.   

     

    1. <form id="form1" method="POST">   
    2.             <%
    3.                 Dim uploader   
    4.                 Set uploader=new AspUploader   
    5.                 uploader.Name="myuploader"
    6.                 uploader.CancelButtonID="uploadercancelbutton"
    7.                 uploader.Render()  
    8.             ?>                  
    9.             <img id="uploadercancelbutton" style='display:none;' alt="Cancel" src="sampleimages/cancel_button.gif" />   
    10.         </form>

     

  •  07-12-2010, 3:20 PM 62439 in reply to 61999

    Re: Cancel All Button

    Please try the following code:
     
    <%@ Language="VBScript" %>
    <!-- #include file="aspuploader/include_aspuploader.asp" -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <title>
      Form - Multiple files upload
     </title>
     <link href="demo.css" rel="stylesheet" type="text/css" />
     <style>
    .AjaxUploaderCancelAllButton {
     display: none !important;
    }
    </style>
     <script type="text/javascript">
     function CuteWebUI_AjaxUploader_OnPostback() {
      //submit the form after the file have been uploaded:
      document.forms[0].submit();
     }
     </script>
    </head>
    <body>
     <div class="demo">                       
            <h2>Selecting multiple files for upload</h2>
      <p>ASP Uploader allows you to select multiple files and upload multiple files at once.</p>
      
       <!-- do not need enctype="multipart/form-data" -->
       <form id="form1" method="POST">
       <%
       Dim uploader
       Set uploader=new AspUploader
       uploader.MaxSizeKB=10333240
       uploader.Name="myuploader"
       uploader.InsertText="Upload File (Max 10M)"
       uploader.MultipleFilesUpload=true
       %>
       <%=uploader.GetString() %>   
       <button id="cancelallbtn"  style='display: none;color:red;' onclick="CancelAll();return false;">Cancel All</button>
       </form>
       <br/><br/>
    <%
    If Request.Form("myuploader")&""<>"" Then
     Dim list,i
     'Gets the GUID List of the files based on uploader name
     list=Split(Request.Form("myuploader"),"/")
     For i=0 to Ubound(list)
      if i>0 then
       Response.Write("<hr/>")
      end if
      Dim mvcfile  
      'get the uploaded file based on GUID
      Set mvcfile=uploader.GetUploadedFile(list(i))
      Response.Write("<div style='font-family:Fixedsys'>")
      Response.Write("Uploaded File:")
       'Gets the name of the file.
      Response.Write("<br/>FileName: ")
      Response.Write(mvcfile.FileName)
      'Gets the size of the file.
      Response.Write("<br/>FileSize: ")
      Response.Write(mvcfile.FileSize)
      'Gets the temp file path.
      Response.Write("<br/>FilePath: ")
      Response.Write(mvcfile.FilePath)
      Response.Write("</div>")
      'Copys the uploaded file to a new location.   
            mvcfile.CopyTo("/uploads")           
            'Moves the uploaded file to a new location.   
            mvcfile.MoveTo("/uploads")   
    Next
    End If
    %>
       
     </div>
     <script type="text/javascript">
        function CuteWebUI_AjaxUploader_OnQueueUI(list)  
        {  
            var cancelallbtn=document.getElementById("cancelallbtn");
             if(list.length<2)
            {  
              cancelallbtn.style.display="none";  
                return;  
            }  
             cancelallbtn.style.display=""; 
        }
        function CancelAll()
     {
         var uploader=document.getElementById('myuploader');
         uploader.cancelall();  
     }
       </script>
    </body>
    </html>
     
     
    Regards,
    Eric
View as RSS news feed in XML