From a0576b60edbceb77f31105bf6e6d3f8d2dd25a09 Mon Sep 17 00:00:00 2001 From: Amparo Oliver Date: Thu, 19 Oct 2023 10:55:30 -0300 Subject: [PATCH] Ruta Imagen --- curriculumsearch/curriculumsearch-0.0.1-SNAPSHOT.jar | Bin 72933060 -> 0 bytes curriculumsearch/src/main/java/com/roshka/ResourceConfig.java | 2 +- curriculumsearch/src/main/java/com/roshka/controller/BirthdayController.java | 2 +- curriculumsearch/uploadsBirthday/953eb5b45c1790b4ea9fa236e8fb0892.jpg | Bin 0 -> 1388080 bytes 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 curriculumsearch/uploadsBirthday/953eb5b45c1790b4ea9fa236e8fb0892.jpg diff --git a/curriculumsearch/curriculumsearch-0.0.1-SNAPSHOT.jar b/curriculumsearch/curriculumsearch-0.0.1-SNAPSHOT.jar index 8ad1048..a2a88b3 100644 Binary files a/curriculumsearch/curriculumsearch-0.0.1-SNAPSHOT.jar and b/curriculumsearch/curriculumsearch-0.0.1-SNAPSHOT.jar differ diff --git a/curriculumsearch/src/main/java/com/roshka/ResourceConfig.java b/curriculumsearch/src/main/java/com/roshka/ResourceConfig.java index 1126bab..5733b8b 100644 --- a/curriculumsearch/src/main/java/com/roshka/ResourceConfig.java +++ b/curriculumsearch/src/main/java/com/roshka/ResourceConfig.java @@ -8,6 +8,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter public class ResourceConfig extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/images/**").addResourceLocations("file:images/"); + registry.addResourceHandler("/uploadsBirthday/**").addResourceLocations("file:./uploadsBirthday/"); } } diff --git a/curriculumsearch/src/main/java/com/roshka/controller/BirthdayController.java b/curriculumsearch/src/main/java/com/roshka/controller/BirthdayController.java index f42e2a1..f2c2cc7 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/BirthdayController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/BirthdayController.java @@ -96,7 +96,7 @@ public class BirthdayController { Path rutaCompleta = Paths.get(rutaAbsoluta); Files.write(rutaCompleta, bytesImg); // Si todo sale bien, guarda la foto en la base de datos - birthday.setFoto("http://192.168.16.90:8888/uploadsBirthday/" + DigestUtils.md5Hex(originalFilename) + "." + fileExtension); + birthday.setFoto("uploadsBirthday/" + DigestUtils.md5Hex(originalFilename) + "." + fileExtension); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/curriculumsearch/uploadsBirthday/953eb5b45c1790b4ea9fa236e8fb0892.jpg b/curriculumsearch/uploadsBirthday/953eb5b45c1790b4ea9fa236e8fb0892.jpg new file mode 100644 index 0000000..00ff925 Binary files /dev/null and b/curriculumsearch/uploadsBirthday/953eb5b45c1790b4ea9fa236e8fb0892.jpg differ -- libgit2 0.26.0