Hi,
Are you using the last version ?
The last version already would automatically replace the file if the MultipleFilesUpload set to flase
Please check this sample:
- <%@ Page Language="C#" %>
- <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Sample</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <CuteWebUI:UploadAttachments runat="server"
- ID="Uploader1" ManualStartUpload="true" MultipleFilesUpload="false" />
- <hr />
- <asp:Button runat="server" ID="SubmitButton"
- OnClientClick="return submitbutton_click()"
- Text="Submit" />
- </div>
- </form>
- </body>
-
- <script type="text/javascript">
- function submitbutton_click()
- {
- var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');
- var uploadobj=document.getElementById('<%=Uploader1.ClientID %>');
- if(!window.filesuploaded)
- {
- if(uploadobj.getqueuecount()>0)
- {
- uploadobj.startupload();
- }
- else
- {
- alert("Please browse files for upload");
- }
- return false;
- }
- window.filesuploaded=false;
- return true;
- }
- function CuteWebUI_AjaxUploader_OnPostback()
- {
- window.filesuploaded=true;
- var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');
- submitbutton.click();
- return false;
- }
- </script>
-
- </html>
Regards,
Terry