hello,
the code below is the code i have used in FileUpload control,it saves the file onto the database directly. i want to save the filepath to the database and not the entire file.
protected void Button1_Click(object sender, EventArgs e)
{
con.Open();
cmd = new SqlCommand("db_vid",con);
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
s = FileUpload1.FileName ;
cmd.Parameters.AddWithValue("@video",s);
cmd.ExecuteNonQuery();
con.Close();
if (FileUpload1.PostedFile.FileName != null && FileUpload1.PostedFile.ContentLength > 0)
{
string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);
string _fpath = Server.MapPath("~/folder") + FileUpload1.FileName;
FileUpload1.SaveAs(_fpath);
Label2.Visible = true;
Label3.Visible = false;
}
}