Re: Upload a specific files from Zip File.

  •  01-06-2010, 3:36 PM

    Re: Upload a specific files from Zip File.

     
    Please refer to the following code:
     
    <%@ Page Language="C#" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected override void OnInit(EventArgs e)
        {
            Attachments1.InsertButton.Style["display"] = "none";
        }  
        void Uploader_FileUploaded(object sender, UploaderEventArgs args)
        {        
            using (System.IO.Stream stream = args.OpenStream())
            {
                Attachments1.Upload(args.FileSize, "ChangeName-" + args.FileName, stream);
            }
        }      
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Uploading multiple files</title>
        <link rel="stylesheet" href="demo.css" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="content">
                <h2>
                    Uploading multiple files (Limit the maximum allowed number of files to be uploaded)</h2>
                <p>
                    This example shows you how to limit the maximum allowed number of files to be uploaded.
                    In the following example, you can only upload 3 files.</p>
                <br />
                <fieldset style="height: 130px">
                    <legend>
                        <CuteWebUI:Uploader runat="server" ID="Uploader1" InsertText="Upload Multiple files Now"
                            MultipleFilesUpload="true" OnFileUploaded="Uploader_FileUploaded">
                         <ValidateOption AllowedFileExtensions="txt"  />
                        </CuteWebUI:Uploader>
                    </legend>
                    <div>
                        <CuteWebUI:UploadAttachments runat="server" ID="Attachments1" >
                        </CuteWebUI:UploadAttachments>
                    </div>
                </fieldset>           
            </div>
        </form>
    </body>
    </html>
     
    Regards,
    Eric
View Complete Thread