Error 3 The type or namespace name 'HttpFileCollection' could not be found (are you missing a using directive or an assembly reference?) D:\saravana\Spatiotemporal Approach\SourceMain\SourceMain\source_fileuploadtomaster.cs 52 13 SourceMain
private void btnupload_Click(object sender, EventArgs e) { HttpFileCollection uploads = HttpContext.Current.Request.Files; for (int i = 0; i < uploads.Count; i++) { HttpPostedFile upload = uploads[i]; if (upload.ContentLength == 0) continue; string c = System.IO.Path.GetFileName(upload.FileName); string filename = System.IO.Path.GetFileNameWithoutExtension(upload.FileName); string extension = System.IO.Path.GetExtension(upload.FileName); string nfilepath; nfilepath = "D:\\saravana\\Spatiotemporal Approach\\SourceMain\\source_uploadfiles\\" + c; try { upload.SaveAs("D:\\saravana\\Spatiotemporal Approach\\SourceMain\\source_uploadfiles\\" + c); //Span1.InnerHtml = "Upload(s) Successful."; } catch (Exception Exp) { //Span1.InnerHtml = "Upload(s) FAILED."; Exp.ToString(); } SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandType = CommandType.Text; cmd.CommandText = "insert into filedetails(filename,filetype,filepath) values('" + filename + "','" + extension + "','" + nfilepath + "')"; if (con.State == ConnectionState.Closed) { con.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Uploaded suxcessfully"); } if (con.State == ConnectionState.Open) con.Close(); } }
System.Web.HttpFileCollection
System.Web
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)