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 8565525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:26:44+00:00 2026-06-11T17:26:44+00:00

I am using C# download method to download an image the image gets downloaded

  • 0

I am using C# download method to download an image the image gets downloaded but its no use its empty or what we say corrupt image does not open.

The issue is the image has unusual link :

http://www.example.com/image1.php

Instead of others like :

http://www.example.com/img1.jpg

So how to download such images, if i go to the image using browser and click save as its downloads fine.

Code:

 System.Net.WebClient client = new System.Net.WebClient();
 picname = "testingimage";
 client.DownloadFile(imagepath, filepath + picname + ".jpg");

Let me know if there is some other ways to do it rite.

Image url :

<img src="http://www.abx.com/img1.php" alt="http://www.abx.com/img1.php" class="decoded">
  • 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-11T17:26:46+00:00Added an answer on June 11, 2026 at 5:26 pm

    I SOLVED IT BUT USING A LONG ROUTE CREATE ANOTHER THREAD TO LOGIN GOTO THAT PAGE AND SAVE THE IMAGE USING WEBBROWSER CONTROL :

    Code to save Image:

     IHTMLDocument2 doc = (IHTMLDocument2)webBrowser1.Document.DomDocument;
                        IHTMLControlRange imgRange = (IHTMLControlRange)((HTMLBody)doc.body).createControlRange();
     string imagename = string.Empty;
     try
     {
     foreach (IHTMLImgElement img in doc.images)
       {
         imgRange.add((IHTMLControlElement)img);
         imgRange.execCommand("Copy", false, null);
         using (Bitmap bmp = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap))
            {
                bmp.Save(@"c:\testImage\TestPic.jpg");
            }
         imagename = img.nameProp;
         break;
    
       }
     }
     catch (System.Exception aaa)
     {
    
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using AsyncTask to download an image and want to send the downloaded image
I'm trying to download a file (an image) with RestSharp using the DownloadData method
I've been using a method for serving downloads but since it was not secure
I am using the WebClient.DownloadString() method to download some data. I am using the
Using the code below each image download) file_get_contents() ) takes on average 8-15 seconds.....
I download an image from an URL asynchronously using WebRequest this way: public void
i am trying to download a image file using ftp, on every code i
I am using WebClient.DownloadFile to download an image to a local repository as follows:
I have some code that retrieves an image from the web using this method
I just want to download an image. Then upload it to Amazon S3. But

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.