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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:02:09+00:00 2026-06-08T01:02:09+00:00

I want to extract the image from server and store it in my local

  • 0

I want to extract the image from server and store it in my local system. The image is displayed as background in <img> tag. How to extract and store the image. The actual image tag is given below

<img style="background:Url('..//contactdetails?data=4512354367432554')" src="some transparent image"/>

In the above tag image is being displayed as background and src contains some transparent image.

  • 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-08T01:02:12+00:00Added an answer on June 8, 2026 at 1:02 am

    You need to perform a request for the image and then save it on your machine.
    First get the URI of the image:

    var html = @"<img style=""background:Url('..//contactdetails?data=4512354367432554')"" src=""some transparent image""/>";
    var regex = new Regex(@"//(?<Path>[^']+)'", RegexOptions.Singleline)
    var uri = regex.Match(html).Groups["Path"].Value;
    

    EDIT

    If you are using HtmlAgilityPack (given that you already extracted the a tag) you can use the Attributes collection to get the style attribute and perform a match against the regular expression or you can use directly the OuterHtml property to match against the pattern like this:

    var anchorTag = YourCodeToGetTheAnchorTag();
    var attribute = anchorTag.Attributes["style"];
    var match = regex.Match(attribute.Value);
    var uri = match.Groups["Path"].Value;
    

    Or, using the OuterHtml property:

    var anchorTag = YourCodeToGetTheAnchorTag();
    var match = regex.Match(anchorTag.OuterHtml);
    var uri = match.Groups["Path"].Value
    

    Next, concatenate the uri of the image to the directory from server, and create a request:

    var fullUri = "http://www.example.com/" + uri;
    var request = (HttpWebRequest)WebRequest.Create(fullUri);
    

    Get the response and save the image:

    var response = request.GetResponse();
    var image = Image.FromStream(response.GetResponseStream());
    image.Save("path-on-your-machine");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to extract: text from following src of the image tag and text
I want to extract an elliptical region from an image (a portion of a
I want to extract kernel symbols from a u-boot image The final goal is
I want to extract the base name from a image URL in Javascript. Would
I want to extract an Image from a PDF file. I tried with the
I want to extract filename with path and its extension separately from image's src
How can I extract a value of an <img> tag from a page that's
I want to extract the background from this CSS and then use it to
I simply want to extract a certain image from a block of html text
How to manipulate image at pixel level. I want to extract information from image

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.