Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8106999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:38:02+00:00 2026-06-06T00:38:02+00:00

In our application, based on some input data, an image will be rendered. The

  • 0

In our application, based on some input data, an image will be rendered. The images are some charts. As part of our test automation I need to download those charts.

I just have image source url. How can I download the image from the source and save it to disk.

I tried of using different methods and able to download the file. But when I try to open the file, getting a message saying ‘not a valid bitmap file,or its format currently not supported.’

Here is my html

<div id="chart">
    <img id="c_12" src="Bonus/ModelChartImage?keys%5B0%5D=UKIrelandEBIT&values%5B0%5D=100&privacyModeServer=False&modelId=Bonus" alt="" usemap="#c_12ImageMap" style="height:300px;width:450px;border-width:0px;" />
<map name="c_12ImageMap" id="c_12ImageMap">

    <area shape="rect" coords="255,265,357,266" class="area-map-section" share="Core Bonus" alt="" />
    <area shape="rect" coords="128,43,229,265" class="area-map-section" share="Core Bonus" alt="" />
</map>    
</div> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:38:04+00:00Added an answer on June 6, 2026 at 12:38 am

    Found the answer. We have to set the cookie container from the web site to your request.

    public static Stream DownloadImageData(CookieContainer cookies, string siteURL)
    {
        HttpWebRequest httpRequest = null;
        HttpWebResponse httpResponse = null;
    
        httpRequest = (HttpWebRequest)WebRequest.Create(siteURL);
    
        httpRequest.CookieContainer = cookies;
        httpRequest.AllowAutoRedirect = true;
    
        try
        {
            httpResponse = (HttpWebResponse)httpRequest.GetResponse();
            if (httpResponse.StatusCode == HttpStatusCode.OK)
            {
                var httpContentData = httpResponse.GetResponseStream();
    
                return httpContentData;
            }
            return null;
        }
        catch (WebException we)
        {
            return null;
        }
        finally
        {
            if (httpResponse != null)
            {
                httpResponse.Close();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our application, we have some forms which need to show some data specifically
We have some part of our application that need to load a large set
In a load test of our PHP based web application we can easily reach
Our application is based on spring, JPA, Hibernate (3.5.1), postgresql 8.4 We will deliver
In our web application (django based, with solr backend) we have some checkboxes with
In our application we need to import transaction data from paypal through an API
I have an Excel-based application that gathers some user input, and makes some calculations
In our application we have some data structures which amongst other things contain a
We are working on developing a Java EE based application. Our application is Java
Our Web application is based on IE9, which means only IE9 can open the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.