Slashdot Mirror


FTP: Better Than HTTP, Or Obsolete?

An anonymous reader asks "Looking to serve files for downloading (typically 1MB-6MB), I'm confused about whether I should provide an FTP server instead of / as well as HTTP. According to a rapid Google search, the experts say 1) HTTP is slower and less reliable than FTP and 2) HTTP is amateur and will make you look a wimp. But a) FTP is full of security holes. and b) FTP is a crumbling legacy protocol and will make you look a dinosaur. Surely some contradiction... Should I make the effort to implement FTP or take desperate steps to avoid it?"

81 of 870 comments (clear)

  1. do both... by jeffy124 · · Score: 4, Informative

    But in my experiences, HTTP for whatever reason goes faster (not entirely sure why), and FTP doesnt work for some because of firewalls.

    Try both - see which gets used more.

    --
    The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
  2. how about rsync? by SurfTheWorld · · Score: 5, Informative

    rsync is a great protocol, fairly robust, can be wrappered in ssh (or not), supports resuming transmission, and operates over one socket.

    seems like the best of both worlds to me.

    the real question is - do you control the clients that are going to access you? or is it something like a browser (which doesn't support rsync).

    --
    Do it for da shorties
    1. Re:how about rsync? by Dr.+Awktagon · · Score: 5, Informative

      Agreed.. I've had enough headaches with FTP and firewalls/NAT, let's just let it die. For robust downloading of large files rsync is the protocol to use.

      For those not familiar: rsync can copy or synchronize files or directories of files. it divides the files into blocks and only transfers the parts of the file that are different or missing. It's awesome for mirrored backups, among other things. There is even a Mac OS X version that tranfers the Mac-specific metadata of each file.

      Just today I had to transfer a ~400MB file to a machine over a fairly slow connection. The only way in was SSH and the only way out was HTTP.

      First I tried HTTP and the connection dropped. No problem, I thought, I'll just use "wget -c" and it will continue fine. Well, it continued, but the archive was corrupt.

      I remembered that rsync can run over SSH and I rsync'd the file over the damaged one. It took a few moments for it to find the blocks with the errors, and it downloaded just thost blocks.

      Rsync should be built into every program that downloads large files, including web browsers. Apple or someone should pick up this technology, give it some good marketing ("auto-repair download" or something) and life will be good.

      Rsync also has a daemon mode that allows you to run a dedicated rsync server. This is good for public distribution of files.

      Rsync is the way to go! I guess this really doesn't 100% answer the poster's question, but people really should be thinking about rsync more.

    2. Re:how about rsync? by virtual_mps · · Score: 2, Informative

      What's your error model? It must be pretty wacky, and therefore unbelievable.

      A 128-bit CRC will be exactly as reliable as an MD5 checksum under all common error models.


      Thank you for pointing out that crc's are designed to look for errors--since in this application the checksum is used to uniquely identify a block, not to check for errors. You've quite succinctly explained the reason crc's won't work.
  3. Http/Ftp which is slower? by emf · · Score: 3, Informative

    "HTTP is slower and less reliable than FTP"

    I would think FTP is slower since with FTP you have to login and build the data connection before the transfer begins. With HTTP it's a simple GET request.

    As far as the actual data being sent, I believe that the file is sent the same way with both protocols. (just send the data via a TCP connection). I could be wrong though.

    1. Re:Http/Ftp which is slower? by spRed · · Score: 0, Informative

      I could be wrong though.

      You were right on that one point...

      an FTP session has two connections, the control which is TCP/IP and data which is UDP. The latency (time to auth etc) is longer on FTP but not really 'slower'

      For the actual benefits and tradeoffs of each just read some of the other posts in the thread.

      --
      .sig Karma out the wazoo, better to spend points elsewhere if this is above 2 or below 0
    2. Re:Http/Ftp which is slower? by treat · · Score: 4, Informative
      an FTP session has two connections, the control which is TCP/IP and data which is UDP.

      This is not true. FTP does not use UDP fpr any purpose.

    3. Re:Http/Ftp which is slower? by DaveBarr · · Score: 5, Informative

      The data connection is most assuredly NOT UDP. It is a TCP connection just like the control connection. But yes, the latency required to initiate a transfer (due to more handshakes) generally makes FTP slower in general.

    4. Re:Http/Ftp which is slower? by Edgewize · · Score: 5, Informative

      FTP supports a single connection (Passive, or PASV in the actual protocol), which is what most web browsers use by default.

      No, no, no. Jesus. Everyone always gets this wrong. FTP in any mode uses two TCP connections. Passive or not, there is a channel for data and a separate channel for commands.

      The difference is that passive-mode means that the client initiates the data connection. The default FTP behavior is for the client to connect to port 21 on the server, and then the server initiates a data connection to the client.

      Non-passive FTP clients are very hard for firewalls to keep track of, especially when NAT is involved. Passive is a little better because both connections are outgoing.

      But at the same time, passive mode makes the server firewall's job tougher, because it requires an large range of incoming ports for the data connections.

      No matter what the mode, FTP is not very firewall-friendly.

  4. for what its worlth by dunedan · · Score: 3, Informative

    Those of your customers who don't have fast access to the internet may appreciate even a slightly faster standard.

  5. HTTP is fine by ahknight · · Score: 4, Informative

    HTTP does not have firewall issues, does not need authentication, does not (by default) allow directory listings, and is the same speed as FTP. It's a good deal for general file distrubution.

    FTP is quickly becoming a special-needs protocol. If you need authentication, uploads, directory listings, accessability with interactive tools, etc. then this is for you. Mainly useful for web designers these days, IMO, since the site software packages can use the extra file metadata for synchronization. Other than that, it's a lot of connection overhead for a simple file.

    FTP does have one nice advantage that HTTP lacks: it can limit concurrent connections based on access privleges (500 anonymous and 100 real, etc.). Doesn't sound like you need that.

    Go with HTTP. Simple, quick, anonymous, generally foolproof.

    1. Re:HTTP is fine by Voytek · · Score: 5, Informative

      [SNIP]
      does not (by default) allow directory listings
      [SNIP]

      That is a dangerous and very incorrect assumption which has nothing to do with http and everything to do with your http server.

    2. Re:HTTP is fine by ahknight · · Score: 2, Informative

      Which is why I said "by default."

    3. Re:HTTP is fine by kwerle · · Score: 2, Informative

      FTP is quickly becoming a special-needs protocol. If you need authentication,

      Yeah, if you need CLEAR TEXT auth, FTP is for you. If you want SSL auth, maybe enable auth for your http server.

      uploads, directory listings,

      Which http can do fine, thanks.

      accessability with interactive tools, etc. then this is for you.

      Dunno about this.

      Mainly useful for web designers these days, IMO, since the site software packages can use the extra file metadata for synchronization.

      I'd push for SSL webdav in an instant...

      Sorry, but I live behind various firewalls and am sick to death of FTP. The sooner it dies, the better.

      (best not to take this post too seriously - FTP just really pisses me off)

    4. Re:HTTP is fine by qnonsense · · Score: 2, Informative

      But "by default" for what server? The HTTP protocol may or may not recommend DIR listings by default, but that's beside the point. Some servers allow it "by default," some don't. Check your server.

      --
      There comes a time in every man's life when he must say, "No mother! I do not want any more Jell-O!"
    5. Re:HTTP is fine by kasperd · · Score: 4, Informative

      The HTTP protocol may or may not recommend DIR listings by default

      No, the HTTP protocol does not even specify the concept of a directory listning. Some servers can generate an HTML file from the directory listning, but that is all up to the server, it can generate that file as it likes or even just serve an error.

      --

      Do you care about the security of your wireless mouse?
    6. Re:HTTP is fine by slim · · Score: 2, Informative

      The HTTP protocol may or may not recommend DIR listings by default

      No, the HTTP protocol does not even specify the concept of a directory listning. Some servers can generate an HTML file from the directory listning, but that is all up to the server, it can generate that file as it likes or even just serve an error.

      Exactly right, and the point is that there is no explicit standard (the may be a few de-facto standards) to say what an HTML directory listing looks like, so coding the equivalent of an FTP client's "mget" command becomes a new job for every site.

      My advice is, if you think your users would like mget or its equivalent, then either give them FTP or think hard about how you could provide the same functionality using HTTP/HTML.

      If they don't need mget, HTTP might be fine.

    7. Re:HTTP is fine by slim · · Score: 2, Informative

      Not if you do it right the first time. Surely directory listnings generated by different servers looks different, but all of those I have seen had one thing in common: They contains links to the files in the directory. So to produce a directory listning from the HTML file is not really a problem if you only need filenames. Just parse the HTML documents and find all links. Remove those links not pointing to files in the directory in question, and remove doubles if any. And once you actually get the files, be prepared to handle nonexisting files correctly.

      It can be done, but it can't be done /trivially/ and the scope for automation is limited. There's nothing /explicit/ in the HTML that states categorically that it's a directory listing, for example, so you need some kind of human input to say "yes, this is a directory listing, use it as a list of stuff to fetch", or "no, this is data I want, fetch it and save it".

      And, more to the point, although there are tools to let you "get everything linked off this chunk of HTML", they're not ubiquitous the way mget is.

  6. Security is the only worry by brokenin2 · · Score: 2, Informative
    If you're just looking to transfer files back and forth, then FTP is the way to go.. If you only want to send out files, you might want to stick with the warm fuzzy feeling by knowing you've only got apache exposed to the outside world.


    We run ftp, but we have to have people send us files, and also distribute them on a regular basis.The client software available for doing the sending and receiving on a regular basis is a lot better for FTP.. it's pretty klunky, but it is very doable for http.


    We just choose to stay on top of our ftp updates.

  7. What do you want to do? by fwankypoo · · Score: 5, Informative

    The question is, "what do you want to do?" I run an FTP server (incidentally affiliated with etree.org, lossless live music!) and I need what it can give me. Namely I need multiple classes of login, each with a different

    1) number of available slots
    2) speed limit
    3) premission set

    Some people can only read files at 60KB/s, some can read and write (to the upload dir) at the same speed, come can only browse, etc. etc. For this kind of a setup, FTP is great _IF_ you keep your software up to date; subscribe to bugtraq or your distro's security bulletin or both.

    On the other hand, HTTP is great when you want to give lots of people unlimited ANONYMOUS access to something. I'm sure there is a way to throttle bandwidth, but can you do it on a class by class basis? In proftpd it's a simple "RateReadBPS xxx" and I'm set.

    As always, choose the tool that fits _your_ purpose, not the one that everyone says is "best"; they both have good and bad qualities. And http can be just as secure/insecure as any other protocol.

    --
    The time of day is 29:33.
  8. Re:FTP by molarmass192 · · Score: 2, Informative

    wget does both and does it well.
    http://www.gnu.org/software/wget/wget.html

    --

    Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
  9. Re:Forget them both.... by Karamchand · · Score: 4, Informative

    I guess that's not what s/he wants. It sounds like anonymous downloading of publicy available files - whatfor do we need any encryption then? There are no passwords to secure, no sensitive data to secure. You'd get only hassles from MSIE users who never heard about sftp..

  10. ftp has more features by AnEmbodiedMind · · Score: 2, Informative

    FTP provides you with user authentication, and binary transfers (which should be faster as there is no encoding??) It can also be linked to via the web, so there's not too much hassle for the user...

    On the other hand, if you don't need user authentication - and don't want to off load big file transfers from your web-server, you may as well just leave it as http.

  11. Re:well, what're you trying to do? by Fastolfe · · Score: 5, Informative

    Furthermore, FTP allows for features such as resume, etc...

    So does HTTP. With the 'Range' header, you can retrieve only a portion of a resource.

    I agree that it really depends on the application, but for most practical "view directory, download file" purposes, there's no significant difference.

    If you wanted to interact with a directory structure, change ownerships, create directories, remove files, etc., it's generally easier to do this with FTP.

  12. Re:In my opinion, by Dragonmaster+Lou · · Score: 2, Informative

    ncftp is a command-line client that shows you your download progress.

  13. Re:hmm by cbv · · Score: 3, Informative
    If it starts loading it usually finishes, and I haven't run into any corruption problems.

    You may (just may) run into a routing or timeout problem, in which case the download will stop and you are forced to do the entire download again. Using the right client, eg. ncftp, you can continue downloading partially downloaded files. An option, HTTP doesn't offer.

    With respect to the original question, I would set-up a box offering both, HTTP and FTP access.

  14. Says who? by jafo · · Score: 2, Informative

    Anyone who says that HTTP is slower and less reliable than FTP probably hasn't done any benchmarking. Based on my experience, HTTP is definitely more reliable if only because it tends to go through firewalls easier then the two-connection FTP protocol.

    Both FTP and HTTP stream data across a TCP socket -- I can't see that streaming it over port 20 versus 80 is going to make any difference.

    FTP was designed to be able to do all these neat things back when the internet didn't have so many security issues. Most of these features are either not used or explicitly disabled these days... The fact that the FTP server uses a different port means that firewall have to understand and properly be configured for this. HTTP sends the data back in response to the initial connection, so it tends to be easier to get through firewalls.

    If you're concerned about looking like a "wimp", then you should offer both and let people pick what they prefer. Or... Stop worrying about what people these people think and figure out what YOU think is best.

    The people who would call you a "wimp" probably aren't worth worrying about.

    Sean

  15. security issues? by Anonymous Coward · · Score: 1, Informative

    You mention FTP is full of security holes. This is wrong, just use a recent ftp server and you won't have any security issues. The same applies with HTTP, lots of bugs were discovered in HTTP servers as well, worms even made good use of them ;-) So ftp is not "less secure" than HTTP!

  16. Re:My opinion by Anonymous Coward · · Score: 1, Informative

    Note that HTTP 1.1 can resume. As long as the user is downloading w/ a download manager that has a clue, that's not a problem.

  17. Re:hmm by toast0 · · Score: 5, Informative

    using the right client, ie wget, you can resume from http streams provided the server supports it (and i think most modern ones do)

  18. My experience.... by ruckc · · Score: 2, Informative

    My experience with FTP/HTTP is due to FTP's authentication it responds slower and is harder to configure, whereas HTTP has near instant authentication & is more easily multithreaded on downloads.

  19. Re:well, what're you trying to do? by linuxhack · · Score: 2, Informative

    Furthermore, FTP allows for features such as resume, etc...

    HTTP 1.1 supports resuming. I have setup Apache to serve movie files that I can play over the network. I can seek back and forth throughout the movie.

  20. ftp is a turd - real men use dns by Anonymous Coward · · Score: 1, Informative
    http is a lot more reasonable protocol. Use it. It can be made to work blazingly fast and it's much more reliable than ftp. Apache is a fine http server but there are others which are faster. But none of that matters; apache on a reasonably modern machine can saturate an ethernet. So who cares about efficiency.

    However, real men write a protocol that works over DNS TXT records using the CHAOS protocol. I'm actually working on this!!!

  21. Re:My opinion by caino59 · · Score: 2, Informative

    IE will resume a d/l too, providing the temp file is still in cache

  22. Re:hmm by cbv · · Score: 2, Informative
    using the right client, ie wget [...]

    Yes, I thought about wget while I wrote my answer - but left it out, simply because _for John Doe_ wget is too complicated. John Doe wants a clickety-click-drag-n-drop client, like a web browser or something like WS-FTP. Granted, ncftp doesn't fall into that category either, but even John Doe can use a simple ftp client.

  23. Hint: If they talk like that, they're not experts. by Kitanin · · Score: 2, Informative

    (Cleaning up the text a bit)

    According to a rapid Google search, the experts say:
    1. HTTP is slower and less reliable than FTP; and
    2. HTTP is amateur and will make you look a wimp; but
    3. FTP is full of security holes; and
    4. FTP is a crumbling legacy protocol and will make you look a dinosaur.

    Well, 2 and 4 are nothing more than acephalic punditry, unworthy of our attention, which leaves 1 and 3.

    The fact that HTTP doesn't use a binary connection to transfer binary files means that, yes, it is frequently slower than FTP. Especially since your listed file sizes imply that you're not offering text files for download.

    While FTP doesn't have any security holes (Yay for false generalisations!), many of the readily available ftp daemons have had shaky track records in the security area.

    I don't really have an answer for you, I just wanted to say acephalic. :-) Acephalic acephalic acephalic...

    --


    Teach your kids: "C++ made baby Jesus cry."
  24. Re:hmm by tom.allender · · Score: 5, Informative
    you can continue downloading partially downloaded files. An option, HTTP doesn't offer.

    Plain wrong. RFC2068 section 10.2.7.

  25. FTP _MUCH_ faster than HTTP by trandles · · Score: 3, Informative

    It is possible to get approximately 80% of the theoretical maximum throughput of your pipe using a single FTP connection, whereas HTTP can hope for around 60% max for a single connection. The only thing faster than an FTP-based protocol (tftp, pftp) is a raw socket, and they rarely get better then 90%. Most schemes like pftp (parallel ftp, see this paper) are implemented to get as close to theoretical maximum throughput by having multiple data connections transfer the file. Of course you'll see the difference in performance more for large file transfers. The previous comment about HTTP being OK for small files is right on the mark...you will hardly notice a 20% gain when the transfers are only taking a few seconds.

  26. Ahem. by kyz · · Score: 2, Informative

    I use two programs to retrieve files, wget and Mozilla. Both show the download rate whether I'm fetching from HTTP or FTP.

    What bugs me is when servers won't tell me the final downloaded file size -- no ETA available. I've seen both FTP and HTTP servers do it. The same goes for servers that don't support resuming or last-modified dates. They suck.

    --
    Does my bum look big in this?
  27. OR, How about... by Anenga · · Score: 5, Informative

    P2P?

    I've written a tutorial on how you can use P2P on your website to save bandwidth, space etc. An obvious way to do this would be to run a P2P client and share the file on a simple PC & Cable Modem. This works, but it is a bit generic and un-professional. A better way to do this may be to run a P2P client such as Shareaza on a webserver. You could then control the client using some type of remote service (Terminal Services, for example).

    P2P has it's advantages. Such as:
    - Users who download the file also share it. This is especially useful if the client/network supports Partial File Sharing.
    - When you release the file using the P2P client, you only need to upload to only a few users. Those users can then share the file using Partial File Sharing etc.
    - Unlike FTP and HTTP, they aren't connecting to your webserver. Thus, it saves bandwidth for you and allows people to browse your website for actual content, not media. (Though, media is content). In addition, there is ussually "Max # of Connections" allowed to a server or FTP. Not so on P2P.
    - P2P Clients have good queuing tools. At least, Shareaza does. It has a "Small Queue" and a "Large Queue". This basically allows you to have, say, 4 Upload slots for Large Files (Files that are above 10MB, for example) and one for Small Files (Under 10MB). Users who are waiting to download from you can wait in "Queue", instead of "Max users connected" on FTP.

    Though, at it's core, all of the P2P I know of uses HTTP to send files etc. But the network layer helps file distribution tremendously.

    1. Re:OR, How about... by Anonymous Coward · · Score: 1, Informative

      > P2P?

      BitTorrent is perfect for this. http://bitconjurer.org/BitTorrent/

      >and if you want me to use my bandwith to upload your file to other people, sorry, forget about it.
      >I agree. My upstream is only 40KBytes, I don't want to share it.

      Because you are uploading pr0n all the time you can't share for.. well say Linux distribution distribution. If they would use BitTorrent there would be a much better possibility of getting that file than downloading it only at 1kbs.

      >also, those clients are a security hazard.
      >I definately agree. Downloading from a "trusted" website gives me at least some peace of mind that I'm not downloading a virus. Granted it's not guranteed - but it's far less likely to get infected from a website than it is form Joe Script Kidie.

      Well, the files get MD5 summed and downloaded on the fly, so there is a very little possibility of changing the files.

      Vote for BitTorrent! =)

      -V

  28. PASV mode still opens a separate data connection by Anonymous Coward · · Score: 1, Informative

    All PASV mode does is allow the client to initiate the data connection, rather than the server. There is still a control connection and a separate data connection.

    This can be helpful when the client is NAT'ed, otherwise the client will send a PORT command with an unroutable address. Of course, if the server is NAT'ed, the reverse will happen. There are stateful NAT devices that will actually exmaine FTP control connections and rewrite PORT commands, but NAT and FTP are basically a pain in the arse to deal with. Throw some encryption in the mix (sftp) with NAT, and you'll understand why FTP is not long for this world.

    Only on Slashdot could you learn that FTP uses UDP for the data connection or that PASV mode only uses a single socket!

  29. HTTP vs FTP by piranha(jpl) · · Score: 2, Informative

    Each has their place.

    FTP was designed for interfacing with the filesystem of a remote Unix system, with the filesystem permissions that are granted to the user you log in as. FTP lets you browse the hierarchy, including examining ownership, permission, and symlink targets; pretty much the same as what you get with 'ls -l'. Apache does file listings, but only shows file names, last modification dates, and size. This makes FTP more suitable than HTTP for remote mirroring of directory trees. This also makes it easier to "browse" what an FTP server has to offer, on a directory-by-directory basis.

    With FTP, the server prints a response when a client connects. Usually, the client sends a user name, password, the 'SYST' command, and asks for the current working directory, tells the server what mode (ASCII or binary) it wants, changes to the directory with the file it needs, sends a PORT command, then finally requests the file. With HTTP, the client connects, sends a request, and the server responds. That's 8 client commands and 9 server responses with FTP, as opposed to 1/1 with HTTP. Each time a command is sent, the client has to wait for the server to respond. The latency adds up, and that means, especially on high-latency connections, FTP is slower to initiate and begin downloading than HTTP. Who said HTTP is slower?

    Regarding reliability, both protocols and modern implementations of their clients and servers have features to resume a broken download from where it left off. Who says one is more reliable than the other?

    HTTP is more simple than FTP. As far as I can tell, in FTP "active mode", the client sends a PORT command with an IP address and port number that is listening. In "passive mode", the server sends an IP address and port number that is listening, after the PASV command. These address/port combinations are used for the actual file transfer.

    Active mode doesn't work if there is NAT between the client and the server, unless the NAT system rewrites the packets so that the IP address the server sees in the PORT command is the outside, external address of the NAT system. When an FTP server is behind NAT, passive mode cannot be used without a similar kluge; it must get an outside-world IP address to connect to from the client, which active-mode PORT does. If both client and server are behind NAT, then one of these NAT kluges must be in effect for file transfer to be possible.

    This address/port nonsense could be part of the security concern with FTP. I also believe older FTP implementations allowed the client (in active mode) or server (in passive mode) to specify arbitrary address/port combinations, so that the FTP server or client could be used as a proxy in an attack. Is this still the case?

    With HTTP, transfers are conducted on the same TCP connection as control is on, and therefore doesn't need to concern itself with IP addresses and ports, and the people using it have fewer NAT headaches.

  30. Depends on the situation. by SWPadnos · · Score: 3, Informative

    As many people have said, it depends.

    FTP has a great advantage in that you can request multiple files at the same time: mget instead of get. Additionally, you can use wildcards in the names, so you can select categories / directories of files with very short commands. (mget *.mp3 *.m3u ...)

    Modern browsers allow you to transfer multiple files simultaneously, but they don't queue files for you - FTP will. This may be important if connections might get dropped - the FTP transfer will complete the first file, then move on to the next. In the event of an interruption, you will have some complete files, and one partial (which you can likely resume). For multiple simultaneous transfers - from an http browser - you may have some smaller files finished, but it's likely that all larger files will be partials, and will need to be retransmitted in their entirety, since http doesn't quite support resuming a previous download.

    So, if you're going to have a web page with many individual links, and you think that most people will download one or two files, http will probably suffice. If you expect people to want multiple files, or that they will want to be able to select groups of files with wildcards (tortuous with pointy-clicky things), then you should have FTP.

    It's not that hard to set up both, and that's probably the best solution.

    --
    - The Sigless Wonder
  31. Re:Forget them both.... by ZoneGray · · Score: 4, Informative

    This is slightly off-topic and sftp isn't what he should be using, but you can change the user's shell to /usr/bin/sftp and add it to /etc/shells. I've only tried it with OpenSSH under Linux, so YMMV. I got the idea from an OpenBSD list, though, so it should work most anywhere.

    To answer the original question, when given a choice, I always download by http. It usually takes less time to set up the connection, probably becasue of those ident lookups that most ftpd's still run by default.

  32. My favorite ftp client by whovian · · Score: 2, Informative

    is ncftp. It's got filename completion and all the file shell commands. I resort to it when mozilla chokes (which is most of the time) -- especially when getting large files.

    --
    To-do List: Receive telemarketing call during a tornado warning. Check.
  33. Re:Forget them both.... by Daytona955i · · Score: 4, Informative

    sftp is not the way to go if you want public access of files. sftp would be the way to go if you were required an account to download/upload files.

    If the files you are serving are large then use ftp. If the files are smaller (less than 10MB) use http.

    http is great, I sometimes throw up a file on there if I need to give it to someone and it is too big to e-mail. (Happened recently with a batch of photos from the car show)

    Since I already have a web page it was easy to just throw the file in the http directory and provide the link in an e-mail.

    I like http for the most part. I doubt anyone will call you lame for using it, unless the files are huge.
    -Chris

  34. HTTP, hands down by Percy_Blakeney · · Score: 5, Informative
    As I understand it, your requirements are:

    1. Download only
    2. 1-6 MB files

      I also assume the following:

    3. You don't need intricate access controls
    4. Non-technical to Somewhat-technical users

    I would say that you should go with HTTP for sure. Of course, you can provide both, but there are some key reasons for using HTTP.

    Easier Configuration Perhaps I'm just not that swift, but I've found that web servers (including Apache) are easier to configure. This is especially true if you have any previous web server experience. Of course, the FTP server is more complex due to its additional features that HTTP doesn't have, but assuming that (c) is true, then you won't need to mess with group access control rights and file uploads.

    Speed This whole "FTP is faster" stuff is not true. HTTP does not have a lot more overhead than FTP; it may even have less overhead than FTP in certain cases. Even when it does have more overhead, it is in the order of 100-200 bytes, which is too small to care about. HTTP always uses binary transfers and just spits out the whole file on the same connection as the request. FTP needs to build a data connection for every single data transfer, which can slow things down and even occasionally introduce problems.

    Easier for Users Given assumption (d), your users will be much more familiar with HTTP URLs than FTP addresses. You could just use FTP URLs and let their web browsers download the files, but then you lose the benefit of resuming partial downloads.

    Simple Access Controls Though some people need to have complex user access rules, you may very well just need simple access controls. HTTP provides this (look at Apache's .htaccess file), and you can even integrate Apache's authentication routines into PAM, if you are really hard core.

    There are a few main areas where FTP currently holds sway:

    Partial Downloads Web browsers typically don't support partial downloads, but the fact of the matter is that the HTTP protocol does support it (see the Range header.) The next generation of web browsers may very well include this feature.

    User Controls Addressed above.

    File Uploads Again, HTTP does support this feature but most browsers don't support it well. Look to WebDAV in the future to provide better support.

    In summary, just use HTTP unless you need complex access rules, resumption of partial download, or file uploading. It will be easier both on you and your users.

  35. Re:hmm by Anonymous Coward · · Score: 1, Informative

    Sometimes it does and sometimes it doesn't for me. I have a feeling that the file size matters as to whether or not IE keeps the file in the cache (Temporary Internet Files as it's called on Windows). I had to restart my huge Animatrix download 2 whole times from over 50% before I said screw it and just got a wget port for Windows.

  36. Re:I wouldn't worry about it... by pixel.jonah · · Score: 2, Informative

    or just do a search for the windows build of wget (wget.exe) - I use it all the time, still isn't a GUI for it though. However if you want to pass in a text file with all the urls you want to download - its killer. and fast too.

  37. My experiences with FTP and HTTP downloads by argonaut · · Score: 5, Informative

    Being in IT for a large Fortune 500 company that sells an operating system among other things (no, not Microsoft), I can share some of my expereinces with you. So take it for what it is worth.

    Our FTP servers run both HTTP and FTP providing the same content in the same directory structure. There are five servers that transfer an average of 1-2 TB (terabyte) per month each, so they are fairly busy. On a busy month each server can go as high as 7 TB of data transferred. File sizes range from 1 KB to to whole CD-ROM and DVD-ROM images. I think the single largest file is 3 GB.

    The logs show a trend of HTTP becoming more popular for the last several years and not stopping. It is currently at 70% of all downloads from the "FTP" servers via HTTP. While the remaining 30% is via FTP. Six years ago (I lost the logs from before this time, they are on a backup tape but I am way too lazy to get that data), it was completely reversed. 75% of downloads were via FTP and 25% were via HTTP. 90% of all transfers are done with a web browser as opposed to an FTP client or wget or something.

    One thing we learned was that many system administrators will download via FTP from the command line directly from the FTP server, especially during a crisis they are trying to resolve. They do this from the system itself and not a workstation. The reasons for this are a bit of a mystery. Feedback has shown that we should never get rid of this or we might be assassinated by our customers. We thought about it once and put out feelers.

    I would say if you don't need to deal with incoming files and you file size is not too large then stick with HTTP. Anything over about 10 MB should go to the FTP server. An FTP server can be more complicated. It seems like the vulnerabilities in FTP daemons has died down in the past year or so. Also, fronting an FTP server with a Layer 4 switch was a lot more tricky because of all the ports involved. If you want people to mirror you then go with FTP or rsync for private mirroring. In reading the feedback, most power users seem to prefer FTP, perhaps because that is what they are used to. Also, depending on the amount of traffic you might need to consider gigabit ethernet.

    The core dumps being uploaded are getting to be huge. Some of those systems have a lot of memory!

  38. Re:My opinion by snol · · Score: 3, Informative

    It'd be nice if Phoenix and Mozilla would acquire that ability. For some reason the developers' stated position is that it won't happen anytime soon, but one can always vote for the bug anyway.

  39. Re:I wouldn't worry about it... by dimator · · Score: 2, Informative

    http://www.interlog.com/~tcharron/wgetwin.html

    This is probably the first thing I get when I'm doing a new windows installation. For larger files, its a must. You also don't have to deal with browsers using their cache directory to download, and then *copying* it to the directory you really wanted. (Who the hell thought of doing it that way?)

    --
    python -c "x='python -c %sx=%s; print x%%(chr(34),repr(x),chr(34))%s'; print x%(chr(34),repr(x),chr(34))"
  40. HTTP simultaneous connections are expensive. by androse · · Score: 3, Informative

    The problem with using HTTP for large file downloads is that, in most cases, it's cheaper ressource-wise to span multiple FTP simultaneous connections than HTTP connections. Of course, this only becomes a real problem if you have more than a few hundred virtual hosts on a single box. So save your httpd processes, and use FTP for large files.

  41. The reason is simple: congestion! by ZorinLynx · · Score: 5, Informative

    Starting multiple TCP connections for a single file download can be advantageous, because of congested network paths.

    If there are 500 TCP downloads ocurring, each download will theoretically get 1/500th the bandwidth.

    Therefore, by opening multiple TCP connections, you will increase the amount of bandwidth for your transfer, at a cost to everyone else using the connection. This is because you've effectively doubled the size of your receive window (one for each connection), causing the host you are downloading from to stuff that many more packets down the pipe.

    The problem is, when everyone does it, it completely negates any advantage to using this method. It also leads to packet loss, since you have that many more TCP connections (each with its own receive window) fighting for pieces of the pie.

  42. Dan Bernstein's publicfile is the answer... by RobbieW · · Score: 2, Informative

    Dan J. Bernstein has written a fantastic, lightweight server that will serve files via either or both FTP and HTTP depending on how the client connects.

    If you want to serve files to the public, this is the most secure way to do so. If you need to provide the files to only certain logins, use something else. If not, you can run this on very lightweight hardware and if it's the only server running, you won't get hacked. Period.

  43. Try scp. Its part of ssh. by molo · · Score: 2, Informative

    scp is your friend. Learn how to use it, and it will handle all of your (non-anonymous) file transfers. It is a beautiful thing.

    --
    Using your sig line to advertise for friends is lame.
  44. Re:hmm by mvdw · · Score: 3, Informative

    Especially since http is faster to connect to than ftp.

    I disagree. Sure, it's easy to browse via http and get one or two files, but when you're trying to suck down the entire directory, http blows (excuse the pun).

    What's faster for getting a whole directory than:

    wget -t 0 -c ftp://ftp.server.name/path/to/dir/*

    Doesn't work with http, because the directory listing doesn't work with wget, at least the version I have.

  45. Re:Forget them both.... by mr.+methane · · Score: 5, Informative

    I provide a mirror for a couple of largish open-source sites, and several of them specifically request that sites provide FTP service as preferred over HTTP. A couple of reasons:

    1. Scripts which need to get a list of files before choosing which ones to download - automated installers and the like - are easier to implement with FTP.

    2. FTP generally seems to chew up less CPU on the host. I can serve 12mb/s of traffic all day long on a P-II 450 box with only 256mb of memory.

    3. "download recovery" (after losing connection, etc.) seems to work better in FTP than HTTP.

  46. FTP The Easy Way by l0gic_f0x · · Score: 3, Informative

    I run a ftp for similar file-sizes (1-6 meg) using a Windows 2000 Pro box (yeah i know i should stick to my preachings about the wonders of linux but im not 100% with my abilities to lock down linux yet) and im using Bulletproof FTP server which is hella cheap but has every feature you can need and is very secure. I highly recommend it. It handles beautifully.

    --


    "Self-destruction might be the answer" --Tyler Durden
  47. Re: sftp by araemo · · Score: 2, Informative

    sftp incurs a terrible CPU overhead, especially if many people are going to be downloading at once. I doubt most web servers could concurrently handle a few dozen 3des encrypted sftp connections without slowing throughput, and if you're hosting files, thats the last thing you want. FTP is supposedly more bandwidth-efficient (though I've never seen proof), but I can still get 400k/sec downstream over http, so I don't think it's a huge problem. I'd just use http for the ease of setup. Securing a public-access ftpd is a true pain.

  48. Re:Different, not better or wose by HMC+CS+Major · · Score: 2, Informative

    lynx, wget, and fetch, all work over http.

  49. Re:hmm by tachyonflow · · Score: 2, Informative

    It would appear that IE6.0 (at least) supports this resume feature of HTTP, when conditions permit. I just tested it by interrupting a large download from my web site.

  50. FTP rulez...but needs help; HTTP too. by MoFoQ · · Score: 2, Informative

    Well there's always the option of FTP over SSH2. I'm sure you can find a Java applet that will do the SSH2 and make the tunnel needed for secure FTP.

    Now when we talk about Java, there's another possibility. Some sites (cr@ck) use a Java downloader. It doesn't mean that the Java applet that downloads the file uses HTTP or FTP, it can be some sort of propriety protocol (or you can combine the best of both worlds.)
    One way is to have the applet on a SSL'ed (https) page and it does some decrypting as it downloads a pre-encrypted file from your FTP. Or the person can just download the encrypted file directly and use the applet on the secured page to decrypt it. There's ALWAYS a way to have your cake and eat it all by yourself, too.

  51. Re:Different, not better or wose by sir99 · · Score: 5, Informative
    lynx, wget, and fetch, all work over http.
    Wget (don't know fetch, but assuming it's like Wget) doesn't let you browse to a file; you have to know the full path in advance, or use recursive downloading, or guess with pattern matching.

    Lynx lets you browse, but you can't do globbing, so you see lots of irrelevant crap, and you have to select files to download one at a time.

    For getting (possibly multiple) files whose location you don't know in advance, FTP is more flexible and efficient.

    --
    The ocean parts and the meteors come down
    Laid out in amber, baby.
  52. Re:No, by sweetooth · · Score: 2, Informative

    Most web servers allow a max number of connections. If one user is eating up six connections that is potentially five fewer people that can download the files. With the case of ISOs the distributor probably has more bandwidth than the person downloading does. Hence it is more effective to serve as many people with as much bandwidth as possible. It's really a curteousness issue to the server operator to not open six connections when one will do.

  53. Apply these three questions... by almaw · · Score: 5, Informative
    You should use FTP if you answer yes to any of the following questions:
    1. Do you have bandwidth issues? If you are serving files to many people, FTP servers allow maximum concurrent users, which can be useful. I know you can do this with HTTP, but it's difficult to segment the downloading >1Mb files traffic from the normal site traffic. A separate service also allows you to use all the Quality of Service stuff in the 2.4 kernel nicely.
    2. Do you have a large array of files that the user might want to download, such that using an FTP client to ctrl+select multiple files is the right answer compared to having your users click on twenty links and have to cope with twenty dialog boxes?
    3. Do your users need to be able to upload files to you? This can be done with HTTP, but you'll need some PHP processing or similar on the server, it doesn't support resuming, and it won't work through many company firewalls, and therefore isn't a good option. HTTP uploading it particularly hopeless for large files, as it provides no user-feedback.
    However, you should NOT use FTP if you answer no to either of these:
    1. Are you running some flavour of unix? There just aren't any robust Windows FTP servers. Yes, I'm prepared for the flame war about this. :)
    2. Can you be bothered to keep your FTPd patched? ProFTPd and WU-FTPd are both frequent appearers on bugtraq. You need to stay on top of the patches, or you will be 0wn3d.
    Simple, see? :)
  54. Re:I wouldn't worry about it... by slagdogg · · Score: 2, Informative

    'wget' with shell script capabilities is a very handy tool indeed ... for f in {0-2}{0-9} ; wget http://somesite.com/images/teen-$f.jpg :|

    --
    (Score:-1, Wrong)
  55. Consider WeebleFM by Anonymous Coward · · Score: 2, Informative

    I just set up WeebleFM http://sourceforge.net/projects/weeblefm/
    It's a PHP front end to FTP. My FTP ports are only open to the loopback interface. Users get the usablity of a clean web interface, and I get to have encrypted password-controlled FTP on a box that only has port 80 open to the internet.

    WeebleFM uses mcrypt to encrypt traffic (and I'm pretty sure I could get it to work over https).

    Using standard unix permissions, a careful directory schem, and vsftpd's chroot capabilities, I can have an internet filesharing arrangement with blind drop boxes, a group accessible directory and any number of world readable directories.

  56. FTP is slower due to TCP Window Size by Anonymous Coward · · Score: 5, Informative

    FTP implementations frequently use a fixed, small window size. HTTP on the other hand will honor the system limit, almost always larger even without tuning.

    Dramatically simplified, it means that the connection can send a lot more packets without hearing back from the far end, enabling the connection to reach higher speeds (imagine a phone call where you had to say 'okay' after every word the other person said. Now imagine only having to say it after every sentence. Much faster.)

    The tiny window size of (most crappy legacy implementations of) FTP starts to affect download speed at just 25ms latency, and has a huge effect over 50ms.

    A properly tuned system with HTTP can make a single high-latency transfer hundreds or even thousands of times faster than FTP.

    Relevant links:
    http://www.psc.edu/networking/perf_tune.ht ml
    http://www.nlanr.net/NLANRPackets/v1.3/windows _tcp tune.html
    http://dast.nlanr.net/Projects/Autobuf/ faq.html

  57. Re:Different, not better or wose by CmdrWass · · Score: 3, Informative

    I tend to agree with this, but for different reasons.

    If you are downloading a file off of a remote server, then there are one of two possibilites:

    1) you know the exact address to the file you are looking for... in this case ftp provides no superior advantage over using lynx or wget since in either case you could have been given the direct URL... either provided as an http url or an ftp url. Basically my point here is that an ftp url is no more or less useful or easy to remember than an http url.

    2) you don't know the address of the file you are looking fore... therefore you are pretty much required to browse via http, to find the site (or page) you want to download from... so since you are already forced to browse for the site, then you might as well use the browser to download. For most people that use graphical browsers, this is great... for those of us (myself included) that use shell browsers (ie lynx and links), this poses little problem as well (unless javascript is required to download a file... I friggen hate javascript... people who use javascript in their websites and have a choice should be fired [note, I use javascript in my works' website... but they make me.. I don't have a choice]).

  58. bittorrent! by Anonymous Coward · · Score: 1, Informative

    You want bittorrent

    http://www.bitconjurer.org/BitTorrent/index.html

    It makes it so a few people start downloading, and they in turn upload what they have to others, and it just kind of "spiderwebs" out, reducing the strain on the original host.

    I wish huge projects (distros, mozilla, etc) started using this. It would make everything SO fast.

    I'm not the guy that coded it, just a happy user.

  59. Re:Different, not better or wose by Archfeld · · Score: 1, Informative

    ftp is much easier to deal with proxy issues. While possible http makes it difficult. Http is nice for quick small files, but SecureFTP or FTP under a SSH with hashing is the best way, read fastest, most reliable way, that I know of.

    --
    errr....umm...*whooosh* *whoosh* Is this thing on ?
  60. FTP is just as doable over SSL by cryptor3 · · Score: 2, Informative

    If you're talking about the human engineering aspect of this discussion only, then I have no disagreement with you. However, FTP is just as technically feasible over SSL, since SSL works at a lower level on the network stack than FTP.

    Furthermore, there are good FTP clients that have SSL support. For example, CuteFTP supports FTP over SSL (and has a very user-friendly interface, for the clueless end user).

    There are a good number of servers supporting FTP over SSL. ServU and Sambar are some of the windows servers. Just do a google see what else there is.

  61. Re:hmm by grolim13 · · Score: 4, Informative

    wget -r -l1 http://http.server.name/path/to/dir/ will suck down all the files in that directory; wget -r -np http://http.server.name/path/to/dir/ will pull it down recursively.

  62. Stop the firewall madness... by yomamasbooty · · Score: 2, Informative

    Seems to be a lot of comments about firewalls and FTP from people who obviously don't work with them. Remember there are three basic types of firewall technology: packet filters, proxies, and stateful inspection.

    Packet filtering alone is always a problem because you have to open up all of the high ports.

    Proxy firewalls and FTP (active or passive) are a no brainer as long as either feature has been enabled. Remember that proxies "watch" the conversation so it will manage the connection if it's data coming back to the client on port 20, and will recognize the 'pasv' command in the command channel.

    Stateful Inspection firewalls include proxying code for the major protocols ie FTP, HTTP, Telnet, etc. So you are covered here as well.

    If you are having problems using FTP through a firewall then you are probably:

    -Are being blocked intentionally

    -Have a lazy security admin who hasn't updated the firewall in five years

    -Have a stupid router jockey "securing" the network with router ACLs (packet filters).

    As long as you are using a major firewall release like Checkpoint, PIX, Netscreen, IPTables, etc, that is up to date there will not be an issue getting FTP to work.

  63. Security Holes? by NerveGas · · Score: 2, Informative

    Serve out anonymous FTP through public file (http://cr.yp.to/publicfile.html). Then there aren't any security holes.

    Really. The security holes in sendmail can be fixed by installing qmail. The security holes in BIND can be fixed by installing djbdns. The security holes in WuFTP (and most others) can be fixed by installing publicfile. There are also other good programs out there as well.

    steve

    --
    Oh, you're not stuck, you're just unable to let go of the onion rings.
  64. Resource usage by MattBurke · · Score: 3, Informative

    I used to run a server which distributed ~3TB/month. Initially I served these files via proftpd, but it soon became apparent that ftp daemons are far too bulky for high-volume serving.

    Enter apache. On the same hardware which keeled under around 30-50 ftp sessions, I could handle over 400 concurrent http sessions, with plenty of ram left over for the vital cacheing :)

  65. Don't forget DiffServ and QoS by sh!va · · Score: 2, Informative

    FTP traffic is given lower priority than HTTP traffic in a large number of packet shaping / DiffServ type routing algorithms.

    These algorithms are based on the assumption that HTTP traffic consists of fairly short bursts and not long sustained transfers which is typically what FTP traffic looks like. Based on these assumptions, these routers give lower priority to FTP traffic than they do to HTTP.

    This does not mean that you should serve large files off HTTP since it'll be "faster". Au contraire, it means that you should be fair to others and serve them over FTP, so that the routers can do the correct packet shaping even if it means a slight speed hit to you.

    Think of people downloading huge files off your web server and screwing up your warcraft (/quake/whatever) game.

  66. Implement them both by Phred+T.+Magnificent · · Score: 2, Informative

    It sounds like your objective is to make files available for download by the public. That being the case, your best solution is to provide both methods and let the person downloading the file determine which method is better for his/her/its needs.

    Some will prefer ftp because it's faster. Others, especially those behind overly-restrictive firewalls, will find that http is a more usable alternative.

    --
    Where is the wisdom we have lost in knowledge?
    Where is the knowledge we have lost in information?
  67. Re:FTP or... by TeddyR · · Score: 2, Informative

    There is a fairly usable client that does both SFTP and FTP over SSL.

    FileZilla
    http://sourceforge.net/projects/filez illa/

    --

    --
    Time is on my side