title: Internet Explorer does not display images - Spring Boot and Thymeleaf
body: <p>In my application I am displaying images. In Chrome, Firefox and Safari everything works fine. If I am using Internet Explorer I get this: <a href="https://i.stack.imgur.com/NXdpu.png" rel="nofollow noreferrer">As Internet Explorer displays the image</a></p>
  
  <p>I already tried to set the ContentType and ContentLength in the Http response:</p>
  
  <pre><code>@RequestMapping(value="/picture-details/{id}", method = RequestMethod.GET)
  @ResponseBody
  public byte[] getImages(@PathVariable final String id, HttpServletResponse response) {
      response.setContentType(String.valueOf(MediaType.IMAGE_JPEG));
      response.setContentLength(b.getDatei().length);
      response.setContentType("image/jpg");
      response.setStatus(HttpServletResponse.SC_OK);
  
  
      return b.getDatei();
  }
  </code></pre>
  
  <p>My HTML Code looks like this:</p>
  
  <pre><code>&lt;img th:src="@{/picture-details/}+${bild.id}" auto-height"id="auto-height" alt='Detail Bild'/&gt;
  </code></pre>
  
  <p>I also found this <a href="https://stackoverflow.com/questions/37052184/image-without-extension-in-src-not-loading-in-ie-alone-and-works-perfect-in-all">Image without extension in src not loading in IE alone, and works perfect in all other browers</a> but unfortunately nothing helped. </p>