Fileupload control example

Fileupload control example

Previous Home Next

 

 The FileUpLoad control enables you to upload file to the server. It displays a text box control and a browse button that allow users to select a file to upload to the server. 

  
   

  

 ................Design code for fileupload control.................
...................................................................

....................................................................
...........................design code for lable...................
....................................................................

....................................................................
................cs code for button clic............................
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, protected void Button1_Click(object sender, EventArgs e)
    {

        Label1.Visible = true;
        if (FileUpload1.HasFile)
        {
            
           
            Label1.Text = "Received "+ FileUpload1.FileName+ " Content Type " + FileUpload1.PostedFile.ContentType + " Length " + FileUpload1.PostedFile.ContentLength;
        }
        else
        {
            Label1.Text = "No uploaded file";
        }
     
       
    }
.....................................................................
Previous Home Next