Skip to content

Commit

Permalink
se corrigio proceso para almacenar archivos en la base de datos[Finis…
Browse files Browse the repository at this point in the history
…hed#73757968]
  • Loading branch information
const3 committed Jun 23, 2014
1 parent 1103e2b commit 1a2a6d7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,6 @@ public String uploadFile(HttpServletRequest request, @ModelAttribute("uploadFile
if (!dirPath.exists()) {
dirPath.mkdirs();
}
uploadFileForm.getFile().transferTo(new File(uploadDir));
sw = true;

log.debug("Archivo {} subido... ", uploadFileForm.getFile().getOriginalFilename());
Expand All @@ -744,6 +743,7 @@ public String uploadFile(HttpServletRequest request, @ModelAttribute("uploadFile
manager.actualiza(detalle, usuario);
request.getSession().setAttribute("esPdf", false);
}
uploadFileForm.getFile().transferTo(new File(uploadDir));

return "redirect:" + Constantes.PATH_INFORMEPROVEEDOR_DETALLE_LISTA;
}
Expand Down Expand Up @@ -1122,6 +1122,7 @@ public String eliminaContrarecibo(@PathVariable Long id, Model modelo) {

@RequestMapping("/asignarFacturas")
public String asignarArchivos() throws FileNotFoundException, IOException {
Usuario usuario = ambiente.obtieneUsuario();
String path = "/home/facturas/2014/06/19/";
File dir = new File(path);
String[] ficheros = dir.list();
Expand All @@ -1135,6 +1136,7 @@ public String asignarArchivos() throws FileNotFoundException, IOException {
if (nombreArchivo.contains(".xml")) {
detalle.setXmlFile(bytes);
}
manager.actualiza(detalle, usuario);
}
return "redirect:" + Constantes.PATH_INFORMEPROVEEDOR_DETALLE_CONTRARECIBOS;
}
Expand Down

0 comments on commit 1a2a6d7

Please sign in to comment.