Re: How do I code for single file manual upload?

  •  02-12-2012, 9:53 PM

    Re: How do I code for single file manual upload?

    Hi dmathews,
     
    The example below shows you how to get the file info after uploaded.
     
    <%@ Page Language="C#" %>
    <%@ Register Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" TagPrefix="CuteWebUI" %>
    <!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>Untitled Page</title>
    </head>
    <script runat="server">
      
        protected void b1_Click(object sender, EventArgs e)
        {
            label1.Text += uploader1.Items[0].FileName;
            label1.Text += "<br />";
            label1.Text += uploader1.Items[0].FileSize;
        }
    </script>
    <body>
        <form id="form1" runat="server">
            <div>
                <CuteWebUI:UploadAttachments ID="uploader1" runat="server" MultipleFilesUpload="false">
                </CuteWebUI:UploadAttachments>
                <asp:Button ID="b1" runat="server" Text="get file info" OnClick="b1_Click" /><br />
                <asp:Label ID="label1" runat="server"></asp:Label>
            </div>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken 
View Complete Thread