简体   繁体   English

FTP和HTTP有什么区别?

[英]What is the difference between in FTP and HTTP?

HTTP is used to display the info and also can be used to transfer files from one host to another host. HTTP用于显示信息,也可以用于将文件从一台主机传输到另一台主机。

FTP is used to transfer files from one host to another. FTP用于将文件从一台主机传输到另一台主机。

So I come to this point that FTP and HTTP both are almost doing the same work. 因此,我要指出的是,FTP和HTTP几乎都在完成相同的工作。 Then what is the exact benefit of using FTP while I can do this with the HTTP? 那么,当我可以通过HTTP进行操作时,使用FTP的确切好处是什么?

Correct me if I am wrong. 如果我错了,请纠正我。

Thanks 谢谢

FTP is a File Transfer Protocol, for transferring files. FTP是一种文件传输协议,用于传输文件。

FTP is significantly older, it is a protocol designed to enable the transfer of files over a long-running session. FTP明显较旧,它是一种协议,旨在支持通过长时间运行的会话传输文件。 There are a wide array of commands and the intent is to allow you to navigate and browse a remote file system and retrieve files (originally over a separate data connection). 有各种各样的命令,其目的是允许您浏览和浏览远程文件系统并检索文件(最初是通过单独的数据连接)。

FTP still sees a lot of use, but many files are actually transferred over HTTP instead. FTP仍然有很多用途,但是实际上许多文件是通过HTTP传输的。

HTTP The HyperText Transfer Protocol was originally designed to transfer hypertext documents and the various assets needed to render them. HTTP超文本传输​​协议最初旨在传输超文本文档以及呈现它们所需的各种资产。 In practice, this is the way information is transferred on the web -- html, css, images, data are all transferred between web servers and web browsers, as well as between one server and another this way. 实际上,这是信息在Web上的传输方式-html,css,图像,数据全部在Web服务器和Web浏览器之间以及在一个服务器与另一台服务器之间进行传输。

HTTP was designed to retrieve a resource from a URL that may or may not match the remote file system (in many web apps, the structure of the URLs has very little to do with the file locations). HTTP旨在从可能与远程文件系统不匹配的URL中检索资源(在许多Web应用程序中,URL的结构与文件位置几乎没有关系)。 There is often only a single request in a single http connection and the data uses the same connection as the request. 在单个http连接中通常只有一个请求,并且数据使用与请求相同的连接。

So I come to this point that FTP and HTTP both are almost doing the same work. 因此,我要指出的是,FTP和HTTP几乎都在完成相同的工作。

Not really. 并不是的。 FTP can be used for file transfer and not really much more. FTP可以用于文件传输,而不能用于其他用途。 HTTP is way more flexible since it not only transfers byte streams but also meta data (what kind of data is this), supports implicit compression, client specific responses (like based on supported languages), has more flexible ways for authentication, is tuned for less overhead (ie can be faster) ... HTTP更加灵活,因为它不仅可以传输字节流,还可以传输元数据(这种数据是什么),支持隐式压缩,特定于客户端的响应(如基于支持的语言),具有更灵活的身份验证方式,可以进行调整较少的开销(即可以更快)...

Then what is the exact benefit of using FTP while I can do this with the HTTP? 那么,当我可以通过HTTP进行操作时,使用FTP的确切好处是什么?

There is no real benefit of FTP today. 今天的FTP并没有真正的好处。 In contrary, in contrast to alternatives like HTTP the design of FTP leads to lots of problems in today's infrastructure where NAT is heavily used (ie multiple internal systems behind a single router with public IP address). 相反,与HTTP之类的替代方法相比,FTP的设计在当今大量使用NAT的基础架构(即位于具有公共IP地址的单个路由器后面的多个内部系统)的基础架构中带来了许多问题。

FTP remains mostly in places where clients or servers don't support more modern ways for file exchange. FTP大多保留在客户端或服务器不支持更现代的文件交换方式的地方。 A typical example is cheap web hosting where access to the server to update files is often done by FTP since lots of tools have FTP builtin and it is easy to setup on the server too. 一个典型的例子是廉价的Web托管,由于许多工具内置了FTP,并且很容易在服务器上进行设置,因此通常通过FTP访问服务器以更新文件。 Alternatives like WebDAV (HTTP based) or SFTP (SSH based) are less used here since they have less support in clients and servers even though they would offer more security and more flexibility and less problems. WebDAV(基于HTTP)或SFTP(基于SSH)​​之类的替代方法在这里使用较少,因为它们在客户端和服务器中的支持较少,即使它们可以提供更高的安全性,灵活性和更少的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM