protected void Button1_Click(object sender, EventArgs e) { string filePath = Server.MapPath("Uploads"); if (!Directory.Exists(filePath)) Directory.CreateDirectory(filePath); HttpPostedFile fileObj; Label1.Text = "Uploaded Files "; int tc = Request.Files.Count; string fname = ""; for (int i = 0; i < tc; i++) { fileObj = Request.Files[i]; if (fileObj.FileName != "") { fname = fileObj.FileName; fileObj.SaveAs(filePath + "\\" + fname); Label1.Text += "<li>" + fname; } } }
John Bhatt Glad to Know, Free to Share..... http://www.johnbhatt.com
Login to post response