Re: Unable to See "Select File" dialog box

  •  12-04-2008, 2:58 PM

    Re: Unable to See "Select File" dialog box

    Adam,
     
    Thanks for replying.
     
    Here's the demowebsite
     
    http://schoolspeak.dyndns.org:10003/Secure/multiple-files-upload.aspx?Community=11111001
     
    This is on a windows 2003 server machine with IIS 6.0
     
    username/password : guest123/guest123
     
    I have set UploadType="iframe". The file dialog box comes on the second click,but i can choose only one file at a time
     
    Here's the sample aspx (it's the same as the example under Framework 2.0-Csharp-NoAjax with a minor modification)
     
    Thanks so much for helping us!!

     
    multiple-files-upload.aspx
    ====================
     
    <%@ 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">
     void InsertMsg(string msg)
            {          
                ListBoxEvents.Items.Insert(0, msg);
                ListBoxEvents.SelectedIndex = 0;
            }

            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
                //SampleUtil.SetPageCache();
                Attachments1.AttachmentAdded += new AttachmentItemEventHandler(Attachments1_AttachmentAdded);
                ButtonDeleteAll.Click += new EventHandler(ButtonDeleteAll_Click);
                ButtonTellme.Click += new EventHandler(ButtonTellme_Click);
            }
            
            void Attachments1_AttachmentAdded(object sender, AttachmentItemEventArgs args)
            {
                InsertMsg(args.Item.FileName + " has been uploaded.");
            }

            void ButtonDeleteAll_Click(object sender, EventArgs e)
            {
                InsertMsg("Attachments1.DeleteAllAttachments();");
                Attachments1.DeleteAllAttachments();
            }
            void ButtonTellme_Click(object sender, EventArgs e)
            {
                ListBoxEvents.Items.Clear();
                foreach (AttachmentItem item in Attachments1.Items)
                {
                    InsertMsg(item.FileName + ", " + item.FileSize + " bytes.");
                    //Copies the uploaded file to a new location.
                    //item.CopyTo("c:""temp"""+item.FileName);
                    //You can also open the uploaded file's data stream.
                    //System.IO.Stream data = item.OpenStream();
                }
            }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Uploading multiple files like GMail</title>
          <link rel="stylesheet" href="demo.css" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
     
                    <div class="content">
                                      
                          <h2>Uploading multiple files like GMail</h2>
        <p> Google's GMail has a nice way of allowing you to upload multiple files. Rather than showing you 10 file upload boxes at once, the user attaches a file, you can click a button to add another attachment. </p>
        <br />                    
        <CuteWebUI:UploadAttachments InsertText="Upload Multiple files Now" UploadType="iframe" runat="server" ID="Attachments1">
            <INSERTBUTTONSTYLE/>
        </CuteWebUI:UploadAttachments>
        <br /><br />    
        <asp:Button ID="ButtonDeleteAll" runat="server" Text="Delete All" />&nbsp;&nbsp;
        <asp:Button ID="ButtonTellme" runat="server" Text="Show Uploaded File Information" />
        <br /><br />
        <div>
            Server Trace:
            <br />
            <asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>
        </div>                 
                        
                    </div>
           
        </form>
    </body>
    </html>

View Complete Thread