0

I am using an URL in src of img tag of HTML to display the image, it works fine in Chrome but in Internet explorer it is a broken link.

This is how the URL looks like, https://AAA.visualstudio.com/_apis/wit/attachments/72651f99-6fb6-4297-94a5-dfff1c5e94b9?fileName=vsts.png

I am guessing, the filename at the end is causing this issue, if its the case what is the solution for this.

Sample code:

<!DOCTYPE html>
<html>
    <body>
      <img src="https://AAA.visualstudio.com/_apis/wit/attachments/72651f99-6fb6-4297-94a5-dfff1c5e94b9?fileName=vsts.png"> 
    </body>
</html>

If I use the same URL to view, it displays the image properly.

EDIT: It looks like the internet explorer is not passing the session details like authentication, so the response I am getting visual studio is Sign in page instead of image data.

Shivaraj
  • 400
  • 5
  • 16
  • you should download + host the img on your local server .. – treyBake Jul 25 '18 at 14:59
  • @Pete depends on the img size, plus if you actually optimise the img, there's no comparison in speed. Also it increases reliability, if visiualstudio.com (in this case) goes down, so does the image – treyBake Jul 25 '18 at 15:03
  • @ThisGuyHasTwoThumbs It's all about the number of requests the browser can process from the same domain - not about the image size – Pete Jul 25 '18 at 15:04
  • @Pete the server* the browser doesn't handle the server handling aspects- I agree to an extent that it may limit server requests, but I much prefer reliability over limiting requests – treyBake Jul 25 '18 at 15:06
  • @ThisGuyHasTwoThumbs have a read: https://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser. Next time you load a page with many images, have a look at your network tab, you will see the images have to wait to be downloaded if the connections to your domain are maxed out – Pete Jul 25 '18 at 15:06
  • @Pete this relates to `Max Number of default simultaneous persistent connections` not `server requests` - also this goes on to say `The limit is per-server/proxy` - where is the info about file requests? – treyBake Jul 25 '18 at 15:09
  • @Pete also . the post is near 10 years old, for `HTTP/1` and nowadays `the successor HTTP/2, was standardized in 2015` - https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol – treyBake Jul 25 '18 at 15:12
  • Seems not related to VSTS side just only you are using the `https://AAA.visualstudio.com` url. – PatrickLu-MSFT Jul 26 '18 at 06:42
  • @PatrickLu-MSFT: When I use the URL, the response I get is of sign in page, which means authentication is missing, which does not happens with chrome. – Shivaraj Jul 26 '18 at 17:15

1 Answers1

0

You can probably see the image in the browser because you are logged into a Microsoft account and therefore have access to the image. To make your html able to access this image you need to make your hosting server log in to that Microsoft account.

Isdeniel
  • 196
  • 10
  • yes, I am logged in that is why I can see the image in browser. The IE should pass the session details so that I can receive the data. – Shivaraj Jul 26 '18 at 14:02