Hi ttyrone,
Please try the example page below, first check if the upload file exists in the store folder, then delete it by the c# code.
- <%@ Page Language="C#" %>
-
- <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <script runat="server">
-
-
-
- protected void uploader1_AttachmentRemoveClicked(object sender, AttachmentItemEventArgs args)
- {
-
- if (File.Exists(Server.MapPath("~/photos/" + args.Item.FileName)))
- {
-
- File.Delete(Server.MapPath("~/photos/" + args.Item.FileName));
- }
- }
-
- protected void uploader1_UploadCompleted(object sender, UploaderEventArgs[] args)
- {
- for (int i = 0; i < args.Length; i++)
- {
- args[i].CopyTo("~/photos/" + args[i].FileName);
- }
- }
- </script>
- </head>
-
- <body>
- <form id="Form1" runat="server">
- <CuteWebUI:UploadAttachments runat="server" ID="uploader1" OnAttachmentRemoveClicked="uploader1_AttachmentRemoveClicked" OnUploadCompleted="uploader1_UploadCompleted">
- </CuteWebUI:UploadAttachments>
- </form>
- </body>
Regards,
ken