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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:38:41+00:00 2026-06-04T15:38:41+00:00

I got some images to download using HTTP. I got these images’ URL, how

  • 0

I got some images to download using HTTP. I got these images’ URL, how to build the TCP-based HTTP buffer to download the image?

I got no library in my current platform, the only supported language in this platform is C, so I have to build the HTTP buffer for these resources.

Currently I have build the normal API request, they are all HTTP request, every request have 0 or more parameters. But the image request got only a URL, such as http://some-image.jpg, it seems just a download job, no API parameters, no authorization, it’s simple, but how to construct the TCP request?

  • 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-04T15:38:42+00:00Added an answer on June 4, 2026 at 3:38 pm

    According to the http://www.jmarshall.com/easy/http/#sample, I build my TCP request like that:

    sprintf(tcp_send_buf, "GET %s HTTP/1.1\r\nHost: %s\r\n\r\n", img_path, img_host);
    
    /* I wrapped TCP APIs for convenient, hope you understand it... */
    set_host_and_port(img_host, 80);
    tcp_send(tcp_send_buf, strlen(tcp_send_buf), recv_callback);
    

    On my recv_callback, I got the server response like that:

    HTTP/1.1 200 OK
    Content-Length: 42299
    Content-Type: image/jpeg
    Last-Modified: Mon, 02 Jul 2007 07:58:47 GMT
    Accept-Ranges: bytes
    ETag: "e2c8b5d17ebcc71:15d5"
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Fri, 25 May 2012 01:33:57 GMT
    
    <binary image data>
    

    I downloaded the image from Chrome, and it’s size is the same as Content-Length: 42299, I think I got the image buffer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using fancybox to display some images. Currently when users hover the image,
I got a request from a client asking to encrypt some images to prevent
I want to get some images from a flash webpage and I got the
i've got some jquery script that changes element image on mouseover and the problem
So I've got a page that shows an image with some absolutely positioned text
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
So I've got one main view with some images on it, and when someone
I've got some image generating code that uses UIGraphicsBeginImageContext(), UIGraphicsGetImageFromCurrentImageContext() and UIImagePNGRepresentation() to do
I've got a set of divs in my page with some images inside of
I have an Applet which is loading images over a http connection using URLConnection.

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.