Facebook avatar image download using Webclient always return 403 status code in asp.net mvc
<p>I am developing an Asp.net mvc Website. In my website , I am downloading facebook avatar image to my server. I am using web client for it. But when I download it always returns 403 status code.</p>

<p>My Facebook avatar URL is something like this</p>

<pre><code>https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/14695341_648936665270833_5179578061817683778_n.jpg?oh=ee4f3c5fd796e9b65053451f4e8b4e16&amp;oe=58906D70
</code></pre>

<p>I download like this</p>

<pre><code>   [AllowAnonymous]
    public string DownloadFacebookAvatar(string url)
    {
        string path = null;
        using (WebClient webClient = new WebClient())
        {

            string filename = "avatar.jpeg";
            string physicalPath = Path.Combine(dir, filename);
            path = dir + "/" + filename;

            webClient.DownloadFile(url, physicalPath);
        }
        return path;
    }
</code></pre>

<p>When I download, it is giving me this error.</p>

<p><a href="https://i.stack.imgur.com/FQLQI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FQLQI.png" alt="enter image description here"></a></p>

<p>What is wrong with my code?</p>