0

In my current scenario im just displaying images from rest api. But it dumpingerror 403. Here is my JSfiddle. Have a look on it , I have tried

<img src="" and also ng-src='' too but still not fetching images from URLs. it is giving these errors: http://prntscr.com/h1kjt3

Positive response will be highly appreciated.

14
  • Everything seems to work in the fiddle? Commented Oct 24, 2017 at 21:00
  • it is not displaying images. Commented Oct 24, 2017 at 21:02
  • prntscr.com/h1kjt3 Commented Oct 24, 2017 at 21:03
  • It's the actual image link that's not working Commented Oct 24, 2017 at 21:04
  • if we open all those URLs in next tab they do work. Commented Oct 24, 2017 at 21:04

2 Answers 2

2

Cloudflare hosted website have an option to Hotlink Protection option. When enabled other websites cannot load these images. Here is a good article explaining.

If it is your website, you can disable Hotlink Protection. If not you cannot use them.

Sign up to request clarification or add additional context in comments.

Comments

0

by using this directive it works:

app.directive('ngSrc', function() {
    return {
        link: function(scope, element, attrs) {
            element.bind('error', function() {
                if (attrs.src != attrs.ngSrc) {
                     window.location.href=attrs.ngSrc;

                }
            });
        }
    }
})

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.