protected void Button_GuardarAdjunto_Click(object sender, EventArgs e) { tools _tools = new tools(); Decimal ID_DETALLE = Convert.ToDecimal(HiddenField_ID_DETALLE.Value); Byte[] ARCHIVO = null; Int32 ARCHIVO_TAMANO = 0; String ARCHIVO_EXTENSION = null; String ARCHIVO_TYPE = null; if (FileUpload_AdjuntosInforme.HasFile == true) { using (BinaryReader reader = new BinaryReader(FileUpload_AdjuntosInforme.PostedFile.InputStream)) { ARCHIVO = reader.ReadBytes(FileUpload_AdjuntosInforme.PostedFile.ContentLength); ARCHIVO_TAMANO = FileUpload_AdjuntosInforme.PostedFile.ContentLength; ARCHIVO_TYPE = FileUpload_AdjuntosInforme.PostedFile.ContentType; ARCHIVO_EXTENSION = _tools.obtenerExtensionArchivo(FileUpload_AdjuntosInforme.PostedFile.FileName); } } String TITULO_ADJUNTO = TextBox_TituloAdjunto.Text.Trim(); String DESCRIPCION_ADJUNTO = TextBox_DescripcionAdjunto.Text.Trim(); Programa _programa = new Programa(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Decimal ID_ADJUNTO = _programa.AdicionarAdjuntoResultadoActividad(ID_DETALLE, TITULO_ADJUNTO, DESCRIPCION_ADJUNTO, ARCHIVO, ARCHIVO_TAMANO, ARCHIVO_EXTENSION, ARCHIVO_TYPE); CargarAdjuntos(); Panel_NuevoAdjunto.Visible = false; Button_NuevoAdjunto.Visible = true; Button_GuardarAdjunto.Visible = false; Button_CancelarAdjunto.Visible = false; }