funciona subirFichero correctamente
This commit is contained in:
@@ -75,13 +75,7 @@ namespace APIFicheros.Controllers
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
int idFichero = Utilidades.guardarFichero(bd, datosFichero.fichero, datosFichero.nombreFichero, datosFichero.descripcion);
|
||||||
byte[] contenidoFichero;
|
|
||||||
var ms = new MemoryStream();
|
|
||||||
datosFichero.fichero.CopyTo(ms);
|
|
||||||
contenidoFichero = ms.ToArray();
|
|
||||||
|
|
||||||
int idFichero = Utilidades.guardarFichero(bd, contenidoFichero, datosFichero.fichero.FileName, datosFichero.descripcion);
|
|
||||||
|
|
||||||
|
|
||||||
documentospolizassg documentoObtenido = bd.documentospolizassg.First( x => x.idDocumento == datosFichero.idDocumento);
|
documentospolizassg documentoObtenido = bd.documentospolizassg.First( x => x.idDocumento == datosFichero.idDocumento);
|
||||||
@@ -93,7 +87,7 @@ namespace APIFicheros.Controllers
|
|||||||
bd.SaveChanges();
|
bd.SaveChanges();
|
||||||
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
return Ok();
|
return Ok("Fichero subido correctamente");
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
public class DatosFicheros
|
public class DatosFicheros
|
||||||
{
|
{
|
||||||
public int idDocumento { get; set; }
|
public int idDocumento { get; set; }
|
||||||
public IFormFile fichero { get; set; }
|
|
||||||
public string descripcion { get; set; }
|
public string descripcion { get; set; }
|
||||||
|
public string nombreFichero { get; set; }
|
||||||
|
public byte[] fichero { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace APIFicheros
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int guardarFichero(bdAsegasa.tscgestionasegasa bd, byte[] fichero,string nombreFichero ,string? descripcion)
|
public static int guardarFichero(bdAsegasa.tscgestionasegasa bd, byte[] fichero,string nombreFichero ,string descripcion)
|
||||||
{
|
{
|
||||||
int idFichero = 0;
|
int idFichero = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"Configuracion": {
|
"Configuracion": {
|
||||||
"SegundosMinimosEntreProcesos": "60",
|
"SegundosMinimosEntreProcesos": "60",
|
||||||
"HoraProcesosDiarios": "06:30",
|
"HoraProcesosDiarios": "06:30",
|
||||||
"NombreConexionBD": "Producción Remoto"
|
"NombreConexionBD": "Desarrollo"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user