File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes FTP v/s HTTP, which one is better? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "FTP v/s HTTP, which one is better?" Watch "FTP v/s HTTP, which one is better?" New topic
Author

FTP v/s HTTP, which one is better?

Ajay Kamble
Ranch Hand

Joined: Jan 23, 2009
Posts: 51
Hello All,

I wish to know differences (advantages/disadvantages) between HTTP and FTP protocols and why would anyone prefer one over other.

To make question simple, imagine that a website is offering download of its products over HTTP. Why would its customers prefer FTP download (what might be the advantages, can we write a script, can we pause-resume it)?

1. For example, if someone is using mainframe machine then he needs FTP download. This can be one reason.

Could you all please help me by appending any points that you can think of?

Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

have a look here


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ajay Kamble
Ranch Hand

Joined: Jan 23, 2009
Posts: 51
I have already tried Google Search. Rather than just knowing differences (definitions etc.), what I want to know is in which scenarios you need FTP or you would prefer FTP over HTTP.

Please let me know if you can suggest anything.
Dan Pyopyo
Greenhorn

Joined: Jan 30, 2010
Posts: 1
no sure if I'm correct.

In my understanding,
you can use https for secure http.
but for ftp , no secure for it.

and for ftp , one the client downloads a file from ftp server.
he/she can see the whole directory of the ftp folder.
then he/she may access other files you don't plan to disclose to s/he
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42274
    
  64
Dan Pyopyo wrote:but for ftp , no secure for it.

SFTP (FTP over SSH) is in widespread use.

then he/she may access other files you don't plan to disclose to s/he

FTP is based on user accounts, so fine-grained access control is possible. That's not a distinguishing characteristic to HTTP (which also supports authentication). It's true that HTTP has no "view directory" functionality (although that can be generally be enabled on the server), but that's not a proper security mechanism, as it amounts to security by obscurity.


Ping & DNS - my free Android networking tools app
Ajay Kamble
Ranch Hand

Joined: Jan 23, 2009
Posts: 51
Still I dont have what I was looking for .

If you have both HTTP download and FTP download as option in what cases you'll prefer FTP,

I can think 2 cases,

1. If you are downloading on mainframe
2. Using FTP you can write a script and then schedule it to run per month, is this right?

Any additional cases you can think?

Regards
-Ajay
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42274
    
  64
1. If you are downloading on mainframe

Maybe I'm missing what you mean by this, but I think all mainframes could serve both FTP and HTTP, so that's not much of a difference.

2. Using FTP you can write a script and then schedule it to run per month, is this right?

Sure you can, but you can do the same for HTTP.

I think I'd base it on what level of authentication is required. Setting up multiple user accounts with their respective permissions is likely to be more of a hassle for HTTP than FTP. If, on the other hand, this is publicly available stuff with no authentication, I'd go with HTTP.
Ajay Kamble
Ranch Hand

Joined: Jan 23, 2009
Posts: 51
Actually, I want to think from client point of view, Not as a server side.

So for example, I am client and I want to download regularly from a site, then why would I prefer FTP?

Mainframe can server both FTP and HTTP, but if I am downloading on Mainframe then I have to use FTP (not sure on this one).
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42274
    
  64
but if I am downloading on Mainframe then I have to use FTP

Why? Any server *can* offer both; whether it actually does, is, of course, a different matter. But that isn't a principal limitation.
Ajay Kamble
Ranch Hand

Joined: Jan 23, 2009
Posts: 51
I am particularly referring to IBM OS/390 and z/OS.

Do you mean it is possible to browse normal HTTP sites from these servers and download over HTTP (consider downloading from sourceforge.net)?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42274
    
  64
Browse *from* those servers? You mean, have a browser running on those OSes? I have no idea; why would you want to do that? But I'm certain that both HTTP and FTP servers are available for them.
Ajay Kamble
Ranch Hand

Joined: Jan 23, 2009
Posts: 51
That is what I am trying to know ,
In which cases you'll prefer FTP download.

1. When I want to download *ON* mainframe machine (not from mainframe server) then I'll use FTP as these servers wont have browsers to browse applications and download required files.

I was hoping to find out more such scenarios where FTP is favorable. This was my question. One case that I can think of is listed above.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

There are some very common and capable command-line HTTP tools like wget and curl, either of which you can use to download a file under script control.

But I'm not sure what the heck we're talking about either. As Ulf was saying, authentication differs between the two; another difference is that traditional FTP can two separate connections, one for commands and one for data, so it can be a little more efficient for complex scenarios involving the transfer of many files.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FTP v/s HTTP, which one is better?