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

Discussion in 'Java' started by yogesh, Apr 19, 2004.

  1. yogesh

    yogesh Guest

    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 :)
     
    yogesh, Apr 19, 2004
    #1
    1. Advertising

  2. yogesh

    chris Guest

    yogesh wrote:

    > 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. :)

    --
    Chris Gray
    /k/ Embedded Java Solutions
     
    chris, Apr 19, 2004
    #2
    1. Advertising

  3. yogesh

    Mohun Biswas Guest

    chris wrote:
    > 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.
     
    Mohun Biswas, Apr 19, 2004
    #3
  4. yogesh

    Liz Guest

    "Mohun Biswas" <> wrote in message
    news:CcPgc.26959$0b4.35376@attbi_s51...
    > chris wrote:
    > > 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.


    In some environments ftp is twice as fast as http
     
    Liz, Apr 19, 2004
    #4
  5. yogesh

    Roedy Green Guest

    On 18 Apr 2004 21:00:41 -0700, (yogesh)
    wrote or quoted :

    >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, ...

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Apr 19, 2004
    #5
  6. yogesh

    Roedy Green Guest

    On Mon, 19 Apr 2004 20:15:22 GMT, "Liz" <> wrote or
    quoted :

    >In some environments ftp is twice as fast as http


    How come? Don't they both just send an almost raw continuous byte
    stream once they get going.
    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Apr 19, 2004
    #6
  7. yogesh

    Liz Guest

    "Roedy Green" <> wrote in message
    news:...
    > On Mon, 19 Apr 2004 20:15:22 GMT, "Liz" <> wrote or
    > quoted :
    >
    > >In some environments ftp is twice as fast as http

    >
    > 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.

    > --
    > Canadian Mind Products, Roedy Green.
    > Coaching, problem solving, economical contract programming.
    > See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Liz, Apr 19, 2004
    #7
  8. yogesh

    Sudsy Guest

    yogesh wrote:
    > 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.
     
    Sudsy, Apr 19, 2004
    #8
  9. yogesh

    Tony Morris Guest

    > 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
     
    Tony Morris, Apr 20, 2004
    #9
  10. yogesh

    JScoobyCed Guest

    "Liz" <> wrote in message
    news:YXWgc.161800$gA5.1908027@attbi_s03...
    >
    > "Roedy Green" <> wrote in message
    > news:...
    > > On Mon, 19 Apr 2004 20:15:22 GMT, "Liz" <> wrote or
    > > quoted :
    > >
    > > >In some environments ftp is twice as fast as http

    > >
    > > 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.
    >


    That was maybe because FTP supports data compression.

    JScoobyCed
    -------------
     
    JScoobyCed, Apr 20, 2004
    #10
  11. yogesh

    Tony Morris Guest


    > 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
     
    Tony Morris, Apr 20, 2004
    #11
  12. Tony Morris wrote:
    >>In some environments ftp is twice as fast as http

    >
    >
    > 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
     
    Thomas Weidenfeller, Apr 20, 2004
    #12
  13. yogesh

    Rogan Dawes Guest

    Sudsy wrote:

    > yogesh wrote:
    >
    >> 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.
    >


    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!

    --
    Rogan Dawes
    nntp_AT_dawes*DOT*za-DOT-net
     
    Rogan Dawes, Apr 20, 2004
    #13
  14. yogesh

    Liz Guest

    "Tony Morris" <> wrote in message
    news:c625oc$kci$...
    >
    > > That was maybe because FTP supports data compression.

    >
    > As does HTTP 1.1
    >


    as does ppp (your modem)

    >
    > --
    > 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
    >
    >
     
    Liz, Apr 20, 2004
    #14
  15. yogesh

    Tony Morris Guest

    "Thomas Weidenfeller" <> wrote in message
    news:c62mmd$a9t$...
    > Tony Morris wrote:
    > >>In some environments ftp is twice as fast as http

    > >
    > >
    > > 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


    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
     
    Tony Morris, Apr 20, 2004
    #15
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gene
    Replies:
    2
    Views:
    2,881
    Saravana [MVP]
    Apr 19, 2004
  2. Navain Goksin

    hosting that provides iis app ext mappings

    Navain Goksin, Jul 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    326
    Craig Deelsnyder
    Jul 12, 2004
  3. Annie
    Replies:
    3
    Views:
    429
    Annie
    Sep 4, 2005
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,007
    Smokey Grindel
    Dec 2, 2006
  5. D. Buck
    Replies:
    2
    Views:
    497
    D. Buck
    Jun 29, 2004
Loading...

Share This Page