9. Creating API to Upload Images in Spring Boot

Поделиться
HTML-код
  • Опубликовано: 18 дек 2024

Комментарии •

  • @vineethchinna3951
    @vineethchinna3951 Год назад +4

    Hi first of all thanks for the content 😃
    have a small question at 7:50 why are we using @ManyToMany, my doubt is one product can have many images so it has be @OneToMany right? those images are only associated with this product right. If we are using @manyToMany those images can be associated to other products also right. I have this confusion can you please explain.

  • @wistoncastaneda3703
    @wistoncastaneda3703 Год назад +1

    Many thanks for the explanation, I have a question, How can I test my RestAPI in a mock tool and upload the images ? (for example Postman) , the thing is that I haven't created the frontEnd like Angular or React yet. So I don't have a visual forms tool.

    • @LearnProgrammingYourself
      @LearnProgrammingYourself  Год назад

      need to check, I was getting issues while checking from postman. so I directly tested from angular UI

  • @Ram_daram
    @Ram_daram 8 месяцев назад

    Hii bro need help , did i need to create all Dao,Controller and service layers for imagemodule

  • @jayanthik274
    @jayanthik274 2 года назад +4

    Please help I get this error when I upload image and press add product button
    Resolved [org.springframework.web.multipart.support.MissingServletRequestPartException: Required request part 'imageFile' is not present]

    • @LearnProgrammingYourself
      @LearnProgrammingYourself  2 года назад

      imageFile is a mandatory parameter use the API. Please make sure you are sending it.

    • @jayanthik274
      @jayanthik274 2 года назад +1

      @@LearnProgrammingYourself how do I do that, can u explain

    • @LearnProgrammingYourself
      @LearnProgrammingYourself  2 года назад

      You can checkout my image upload video. In that I have explained step by step.

    • @rohitprajapati1113
      @rohitprajapati1113 Год назад

      API for posting Data and image at a same time it's not working I checked in postman showing error: Unsupported Media Type

    • @G.Amusicofficial
      @G.Amusicofficial Год назад

      @@rohitprajapati1113 Estou com mesmo problema!

  • @mustafazayed8308
    @mustafazayed8308 Год назад +1

    Does this playlist cover the whole project backend + frontend?

  • @ashishbhilawade646
    @ashishbhilawade646 2 года назад +1

    Best videos..🙏..keep doing videos...these are useful for us..✌ Thanks varadraj..

  • @anushgm4947
    @anushgm4947 2 года назад +3

    Bro this is Anush. I need to know how to connect this spring boot API with angular so that when a user uploads an image it get saved into sql/mysql database

    • @LearnProgrammingYourself
      @LearnProgrammingYourself  2 года назад +1

      Yes you will see video on this in one day

    • @anushgm4947
      @anushgm4947 2 года назад +1

      @@LearnProgrammingYourself Thanks bro hope I will get it soon

    • @anushgm4947
      @anushgm4947 2 года назад +1

      @@LearnProgrammingYourself I am eagerly waiting for this video bro 🧐

  • @koffijeanclaudekouame8033
    @koffijeanclaudekouame8033 Год назад +1

    Hello Sir, I got this error when I uploaded image
    Resolved [org.springframework.web.multipart.support.MissingServletRequestPartException: Required request part 'imageFile' is not present. So I do I test this in postman or swager. I uploaded image in image field, but it not working... Can you show how to test it using postman in a short video for us who are beginers? Thanks in advanced.

    • @LearnProgrammingYourself
      @LearnProgrammingYourself  Год назад

      Yes will do this😊

    • @andilesimelane4771
      @andilesimelane4771 Год назад

      @@LearnProgrammingYourself Good day hope this finds you well. Please help testing this on post man. I n my case, I have a course with just cover image so i didn't make the separate table for that since its just one image instead added just a column. So when I test with post man using form-data it get error Required part 'course' is not present.]

    • @andilesimelane4771
      @andilesimelane4771 Год назад

      @@LearnProgrammingYourself
      Below is my code snippet
      @PostMapping(consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
      public Course SaveCourse(@RequestPart("course") Course course, @RequestPart("image")MultipartFile file) throws IOException {
      //upload images
      String imageName = file.getOriginalFilename();
      String contentType = file.getContentType();
      byte[] ImageByte = file.getBytes();
      try {
      file.transferTo(new File("images/" + imageName));
      } catch (IOException e) {
      System.out.println(e.getMessage());
      throw e;
      }
      course.setImage(ImageByte);
      course.setCover_image(imageName);
      return courseService.saveCourse(course);
      }

  • @haithammuhamad7892
    @haithammuhamad7892 2 года назад +2

    Excellent explanation ,
    i want to ask you why you don't save image in file in the server not in database , becouse if alot of picture or file save in database it make it slowly .
    thank you

    • @LearnProgrammingYourself
      @LearnProgrammingYourself  2 года назад +1

      Yes in the future we can think on that. My current focus is on getting the things to work. But once we get the basic working application then we can think on enhancements

  • @syawadhilahpradipta828
    @syawadhilahpradipta828 Год назад +1

    do you mind if I ask, if you have repo for this project? if yes, do you mind if I see it?

  • @alljobcircularpreparation3163
    @alljobcircularpreparation3163 10 месяцев назад +1

    wonderful

  • @georgiosstaniogloudis9077
    @georgiosstaniogloudis9077 Год назад +1

    hey nice video, can you show also the productService code or at least the addNewProduct? Also your repo, thank you very much!

  • @bharathkumar-uj8hp
    @bharathkumar-uj8hp 2 года назад +1

    how to test this using postman

  • @AkshayKumar-jf5we
    @AkshayKumar-jf5we 2 года назад +1

    👌... Can you make a video on joining collections in mongodb with spring boot and also uploading documents using API

  • @priyankabhavsar7248
    @priyankabhavsar7248 2 года назад +1

    Hello I got error 401 authentication

  • @kakuturuuma5194
    @kakuturuuma5194 Год назад

    Please provide the source code

  • @khanhouc7891
    @khanhouc7891 Год назад +1

    Please help me
    i get 415 error