Show image with variable name Thymeleaf Spring Boot

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ม.ค. 2025

ความคิดเห็น • 6

  • @murloteg
    @murloteg ปีที่แล้ว

    This video about saving files on file system (in db we saving only file name and file path).
    Thank you, author! It's very helpful

    • @discospiff
      @discospiff  ปีที่แล้ว

      Outstanding! I'm glad it helped. I hope you're building something awesome!

  • @jumbohero400
    @jumbohero400 9 หลายเดือนก่อน

    Hello sir,
    Thank you making this video helped me a lot. I just had a question regarding this. Is it possible to store the image temporarily. I am trying to save the image temporarily so that if the image is a valid image ( ie less than 10mb ) etc but the other attributes are invalid the form resets but the image data stays there. Such that only if the the form is valid overall the image is stored(put into the folder). And also such that if the form page itself is closed ( closing the tab)the image is like not saved at all.

  • @НикитаДукин-й8ю
    @НикитаДукин-й8ю 4 ปีที่แล้ว

    Oh, i tried it in this way, but i'm getting the exception... Thymeleaf is trying to parse in my relative path to image? Could you give me a hint, please, what can be wrong with this exception? (I have no "/photo/" path, just "/static/") Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NumberFormatException: For input string: "0.jpg"] with root cause

  • @mstam853
    @mstam853 3 ปีที่แล้ว

    Thank you so much for making & sharing this playlist, awesome stuff! There are a few things that are still a bit confusing to me. In a real-world application, would we be uploading to cloud our spring boot app, database (photo meta data) and photos, separately? Is there a use case when we would want to have photos in our project folder? Let's say we are building a social media app and want to view a profile photo we just saved. How would that work, on a high level? Would we need to look up the photo from the cloud (via some URI) in our spring boot app? Thanks!

    • @discospiff
      @discospiff  3 ปีที่แล้ว +1

      In the cloud, I'd host the application in one place, the data in another, and the photos in another, so that they can scale, and be cached, separately.
      Firebase has a good model for this: data stays in Firebase Cloud Firestore, and the images are in Firebase Cloud Storage.
      I'll confess, storing the images in the project was a time saving shortcut, meant to keep this video in a reasonable time. That's all. :)