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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:08:23+00:00 2026-05-14T18:08:23+00:00

How are files downloaded from servers in programming languages like C? I understand higher

  • 0

How are files downloaded from servers in programming languages like C? I understand higher level languages have magic functions like “download_file_from_url()” but they don’t help me understand what is actually going on. I’m a little familiar with sockets but network programming in general is still a black box to me. Thanks for any help.

  • 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-05-14T18:08:23+00:00Added an answer on May 14, 2026 at 6:08 pm

    Basically, at a low-ish level, the program is opening a socket to port 80 (usually) on the server and sending it a request that looks something like this:

    GET /index.html HTTP/1.1
    Host: stackoverflow.com
    

    …followed by a blank line.

    The server then responds with the data, which typically consists of a few header lines, a blank line, and the requested resource. With HTTP 1.1 the default is to keep the connection alive for subsequent requests (although the server could terminate it if it liked); if I’d used HTTP 1.0 or added a Connection: close header, the server would break the connnection after sending the resource.

    Check out the Wikipedia article on HTTP for details, or if you really want to get into it, check out the spec (all-in-one-page here). You can see what this looks like for yourself if you have telnet (and you probably do). Just type telnet stackoverflow.com 80 and then type in the lines above. Remember to press Enter on the blank line.

    You do not want to reinvent this wheel. Virtually all languages and environments have a library available to help you that deals with all of the intricacies. (For instance, try the example above with www.stackoverflow.com instead of stackoverflow.com in both places — you get back a “moved permanently” response because the SO team want SO to be at stackoverflow.com, not www.stackoverflow.com. There are also “moved temporarily” responses, etc., etc.)

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

Sidebar

Related Questions

I have an application that saves files downloaded from a server. These files are
I am starting a project that will have many files (like a web servers
I have a small app that downloads some files from a remote (HTTP) server
I wrote a program that downloads some files from some servers. Currently program works
I have this very complicated requirement. We have a bunch of zipped files downloaded
We have a ftp system setup to monitor/download from remote ftp servers that are
I have an app that downloads ZIP files from my server, and can download
I downloaded Liferay files from a livesite to setup a local environment for some
I'm trying to get a bunch of HTML files downloaded from the internet and
I have an application that serves artifacts from files (pages from PDF files as

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.