Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Browser download files (via HTTP or FTP)

Please forgive me if it seems a silly question, I have this doubt and couldn't find the answer on the web.

How browser and any other downloader downloads a file, which protocol is working at the backend HTTP or FTP.

As we all know HTTP can be used to transfer text, which can be rendered by the browser. It can also send binary data.

Let's say I want to access a webpage at www.xyz.com/index.aspx which has a static webpage with 2 images. As we all know a total of 3 HTTP requests will be made, one for webpage and other 2 for images.

But what about other files which have a big size. I mean suppose I'm downloading an mp3/mp4 files (having link given on the webpage). So, what protocol is working at the backend HTTP or FTP.

like image 242
Atinesh Avatar asked Mar 06 '16 16:03

Atinesh


People also ask

How do browsers download files?

Fetching files from the server Traditionally, the file to be downloaded is first requested from a server through a client — such as a user's web browser. The server then returns a response containing the content of the file and some instructional headers specifying how the client should download the file.

Is HTTP used to download files?

Hypertext Transfer Protocol (HTTP) downloads use the same protocol as browsing websites to send the file data. It is the most popular way to download files from the internet. All web browsers use this to download files directly.

Should I use HTTP or FTP?

Ultimately, FTP is more efficient at transferring large files, whereas HTTP is better for transferring smaller files such as web pages. Although both utilize TCP as the protocol of choice, HTTP uses a persistent connection, thus making the performance of the TCP better with HTTP than with FTP.

Is FTP used for downloading files?

FTP clients are used to upload, download and manage files on a server.


1 Answers

It depends on the url :

ftp://www.example.com/bla/bla/bla01.zip

will be fetched via ftp, and

http://www.example.com/bla/bla/bla01.zip

will be fetched via http

Of course we cannot simply change http:// with ftp:// as http need an http server, and ftp need an ftp server.

like image 165
Tantowi Mustofa Avatar answered Sep 27 '22 20:09

Tantowi Mustofa