why use ftp if http provides the same services???

Y

yogesh

when downloading a file often the websites give two option..either
download it from a ftp site or http..
what is the difference between downloading a file(non
html.eg.word,spreadsheet file) from http server and ftp server.?
if the http server could also provide the service of storing the
downloadable file then why ftp servers are used?

regards,
Yogesh

ps: this is a general question so applies to java also :)
 
C

chris

yogesh said:
when downloading a file often the websites give two option..either
download it from a ftp site or http..
what is the difference between downloading a file(non
html.eg.word,spreadsheet file) from http server and ftp server.?
if the http server could also provide the service of storing the
downloadable file then why ftp servers are used?

regards,
Yogesh

ps: this is a general question so applies to java also :)

On the contrary, there are _much_ better places to ask this question:
comp.protocols.* would be one place to look.

FTP has been around a lot longer. FTP clients often support a few features
which are still not common in HTTP, such as automatically translating text
files between DOS/Unix/Mac formats, and being able to pick up a failed file
transfer from where it failed. Etc. But if you just want to make some files
available for download on your web site, you may as well stick to HTTP and
have one less protocol to worry about.

Now stop asking off-topic questions. :)
 
M

Mohun Biswas

chris said:
FTP has been around a lot longer. FTP clients often support a few features
which are still not common in HTTP, such as automatically translating text
files between DOS/Unix/Mac formats, and being able to pick up a failed file
transfer from where it failed. Etc. But if you just want to make some files
available for download on your web site, you may as well stick to HTTP and
have one less protocol to worry about.

One significant difference from the end-user perspective is that HTTP
provides a Content-Length header which allows the downloading browser to
provide a reasonable progress bar. FTP has no way of knowing, and thus
no way of telling you, how much data it needs to get.
 
L

Liz

Mohun Biswas said:
One significant difference from the end-user perspective is that HTTP
provides a Content-Length header which allows the downloading browser to
provide a reasonable progress bar. FTP has no way of knowing, and thus
no way of telling you, how much data it needs to get.

In some environments ftp is twice as fast as http
 
R

Roedy Green

when downloading a file often the websites give two option..either
download it from a ftp site or http..
what is the difference between downloading a file(non
html.eg.word,spreadsheet file) from http server and ftp server.?
if the http server could also provide the service of storing the
downloadable file then why ftp servers are used?

FTP is the older protocol. There is higher probability of restart
picking up where you left off being supported. FTP programs such as
FTP voyager are more sophisticated in what you can do, both download,
upload, get multiple files, ...
 
L

Liz

Roedy Green said:
How come? Don't they both just send an almost raw continuous byte
stream once they get going.

I don't remember the details, but a couple of years this was my experience.
 
S

Sudsy

yogesh said:
when downloading a file often the websites give two option..either
download it from a ftp site or http..
what is the difference between downloading a file(non
html.eg.word,spreadsheet file) from http server and ftp server.?
if the http server could also provide the service of storing the
downloadable file then why ftp servers are used?

Two reasons:
- performance
- firewalls
vis:
- FTP is typically more efficient, i.e. there's less protocol overhead
compared to HTTP.
- Corporate firewalls often restrict the use of the ports needed to
use FTP. Port 80 (HTTP) is usually wide open.

So it depends on your target market. But Chris is quite correct in that
this is not really a Java question, merely one which affects those of
us attempting to make our Java services available to the largest user
population.
 
T

Tony Morris

In some environments ftp is twice as fast as http

Absolute bollocks.

--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform
 
J

JScoobyCed

Liz said:
I don't remember the details, but a couple of years this was my experience.

That was maybe because FTP supports data compression.

JScoobyCed
-------------
 
T

Tony Morris

That was maybe because FTP supports data compression.

As does HTTP 1.1


--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform
 
T

Thomas Weidenfeller

Tony said:
Absolute bollocks.

I have seen it happen when providers did traffic shaping or ran a
transparent http proxy (which was overloaded). Of course, this is not a
property of the protocol, but of the network. And, of course, if the
traffic shaping is configured differently, it can very well happen that
ftp on that particular network is half as fast as http.

/Thomas
 
R

Rogan Dawes

Sudsy said:
Two reasons:
- performance
- firewalls
vis:
- FTP is typically more efficient, i.e. there's less protocol overhead
compared to HTTP.
- Corporate firewalls often restrict the use of the ports needed to
use FTP. Port 80 (HTTP) is usually wide open.

So it depends on your target market. But Chris is quite correct in that
this is not really a Java question, merely one which affects those of
us attempting to make our Java services available to the largest user
population.

I believe that HTTP is much more efficient for anonymous downloads than
FTP is, due the the limited number of connections and conversations
required. For FTP, there is a whole process that has to be followed
before the first byte of real data is transferred:

connect to server on port 21, receive banner and login prompt
supply username
receive password prompt
supply password
receive OK message
change directory
receive OK message
set binary mode
receive Ok message
request PASV mode (optional, but likely)
receive OK message
request filename
receive data port on server to connect to
open TCP connection to new port
start downloading data file

v.s.

connect to server on port 80, request file and supply some headers
Server sends a few headers back, and immediately follows with the data

HTTP is also better supported by secure proxies than FTP is, as well as
supporting proxy authentication, which is usually a kludge in FTP.

HTTP also supports automatic compression of content (mod_gzip, for
instance), but if that is a concern, you would probably be supplying
pre-compressed data to start with.

HTTP/1.1 also support reconnects and partial transfer (resume). You may
argue that this is not that common, but that is implementation, and not
protocol.

The only thing that FTP is natively better at than HTTP, in my opinion,
is *authenticated* file uploads, and even this can be overcome by an
application, or implementing the PUT method. A web application for doing
large authenticated file uploads will most likely be 75% as efficient as
an FTP upload, due to the MIME encoding of the POST body. This is not an
issue when using the PUT method.

However, most browsers do not support PUT, I think. You could probably
write a custom script to do this (as you could with POST, in fact), but
this post is long enough already!
 
T

Tony Morris

Thomas Weidenfeller said:
I have seen it happen when providers did traffic shaping or ran a
transparent http proxy (which was overloaded). Of course, this is not a
property of the protocol, but of the network. And, of course, if the
traffic shaping is configured differently, it can very well happen that
ftp on that particular network is half as fast as http.

/Thomas

Yes, this is a possibility.
As you pointed out, this still doesn't mean that "FTP is faster than HTTP".

--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top