Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


File upload in dotnet
Question Posted on 30 Jun 2011

Home >> DotNet >> ASP.NET >> File upload in dotnet




Here is the html code of the webpage
asp:FileUpload ID="FileUpload1" runat="server"
asp:Label ID="lblMessage" runat="server" Font-Bold="True" ForeColor="#0033CC" Visible="False"

Here is the code behind file
protected void btnUpload_Click(object sender, EventArgs e)
{
 if (FileUpload1.HasFile)
  {
   try
   {
    string filePath = Server.MapPath("./") + System.IO.Path.GetFileName(FileUpload1.FileName);
    FileUpload1.PostedFile.SaveAs(filePath);
    lblMessage.Text = "File uploaded to " + filePath;
    lblMessage.Visible = true;
   }
   catch (Exception ex)
   {
    throw ex;
   }
  }
}
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Use of Calendar control in dotnet with code
How to improve Front End UI performance of dotnet web application?
File upload in dotnet
reverse a string
function of garbage collector






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |