protected void btnSubirFotoModal_Click(object sender, EventArgs e) { if (fuFotoEmpleado.HasFile) { int EmpleadoID = Int32.Parse(Session["EmpleadoID"].ToString()); string filename = Path.GetFileName(fuFotoEmpleado.PostedFile.FileName); string contentType = fuFotoEmpleado.PostedFile.ContentType; EmpleadoDAL empleado = new EmpleadoDAL(); using (Stream fs = fuFotoEmpleado.PostedFile.InputStream) { using (BinaryReader br = new BinaryReader(fs)) { byte[] bytes = br.ReadBytes((Int32)fs.Length); int n = empleado.ActualizarFotoEmpleado(EmpleadoID, bytes); } } } Response.Redirect(Request.Url.AbsoluteUri); }