tags:

views:

266

answers:

3

WARNING: content not work-appropriate

This does not retrieve image successfully from a web page on a local dev box:

<img src="http://78.140.144.230/indecent.me/1/337707.jpg"/&gt;

However, if I put http://78.140.144.230/indecent.me/1/337707.jpg into the URL field of firefox, the image gets returned.

Any ideas how to get this working from an img tag? Note that the img tagged worked in the preview pane of stackoverlow.

+1  A: 

I presume that the site you're linking to is checking the HTTP Referer (sic) field to block hotlinking (linking to images from another site). Whenever you click on a link your browser automatically sends your current URL to the server you're visiting so the linked server can see where users are coming from. When you type a URL directly in the URL bar there is no Referer header since you're not coming from anywhere.

If you control this server you'll want to talk to the server admin to disable this, or move your HTML pages so they're hosted on the same server. If not you'll need to host your image elsewhere on a server that doesn't prevent hotlinking.

John Kugelman
+2  A: 

It looks like this image is being blocked based on the Referer [sic] header. If I click on the link directly, which causes Referer header to be the URL of this page, I get a 403 forbidden error. If I copy the URL into my address bar, which sends no Referer header, I can access the image just fine. This is a technique to prevent people at other sites from embedding someone else's image in their pages; that consumes bandwidth for the site hosting the image, without any benefit to the person hosting the image.

If you have permission, you should copy the image to your own web server and host it from there. Otherwise, you should find a different image to use.

Brian Campbell
A: 

For all tests I viewed firefox net status:

clicked link from here,

made one line html on desktop,

uploaded same html to server.

In all three cases, no problems and no referrer mentioned.

So unless you just talked to the server admins and made them your best friend, It's not a hot-linking issue (even if it is a hot link).

It's also not my first guess, which was the lack of space between the " and /> in your element.

So my next best guess is that you have an issue with your server specifically.

Anthony