Killua
Killua

Reputation: 81

What is the difference between the URL "file://" and "http://"

I was asked this question in one of my assignments. I was wondering what the difference is in the URLs of the attached image. I know it has something to do with the "file://" and "http://" but I'm not sure how to explain or phrase it.

enter image description here

Upvotes: 7

Views: 8280

Answers (4)

Praveer Kumar
Praveer Kumar

Reputation: 1008

First of all you need to understand about the file and http. Both are protocols and serves two different purpose. for your reference:

fileProtocol

HTTPProtocol

Upvotes: 3

campovski
campovski

Reputation: 3153

A file requested via file:// gets opened from local drive. A file requested via http:// gets via HTTP request to URL that comes after it. The second might come from your own computer (example http://localhost ...) or from anywhere on the web. Although the image might be the same as in your example, it is served via two different protocols.

Upvotes: 1

Rafael Araújo
Rafael Araújo

Reputation: 201

file:// is a request for a local file. http:// is using HTTP protocol to request a file somewhere, including -- if it's the case -- on your local computer.

Upvotes: 2

Phil Standen
Phil Standen

Reputation: 55

They have different schemes. One says look on the file system, the other says make a HTTP request.

Upvotes: 1

Related Questions