将文件从客户端传输到服务器
问题描述:
hi
在我的项目中(项目律师,所以您将是大文件)需要将文件从客户端发送到服务器,然后将其保存在DB中
我读到有关此问题的信息,发现该问题(使用ftp)发送文件
因此在开始编写代码之前,任何人都可以清除答案,我必须使用FTP吗?
hi
in my project(Project lawyer so you will be large files) need to send file from client to server then save it in DB
i read about this issue i found (using ftp )to send file
so before start in code write can anybody clear for answer and i must use FTP there is other way ?
答
这是问题:没有这样的事情只是服务器"或只是客户端".这完全取决于您拥有或可以安装的软件,以及许多其他因素.
至于FTP,它不仅在所有情况下都有效.您不能在一侧运行它,因此需要在服务器端运行一些FTP服务器.
对于非常简短且绝对不完整的概述:通常使用应用程序层的协议执行文件交换:
http://en.wikipedia.org/wiki/Application_layer [ http://en.wikipedia.org/wiki/Application_layer [ http://en.wikipedia.org/wiki/File_Transfer_Protocol [ http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol [ http://en.wikipedia.org/wiki/FTPS [ http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol [ http://en.wikipedia.org/wiki/HTTPS [
Here is the thing: there is no such thing as "just server" or "just client". It all depends on software you have or can install, and a number of other factors.
As to FTP, it won''t just work in all cases. You cannot run it on one side, so you need to run some FTP server on the server side.
For a really short and absolutely incomplete overview: the files exchange is usually performed using the protocols of the application layer:
http://en.wikipedia.org/wiki/Application_layer[^].
I would list three most applicable cases: FTP, HTTP and the custom application-level protocols (something you develop for only one application, without concerns of compatibility with third-party products) mostly on top of TCP. When FTP or HTTP protocols are considered, one should also consider their secure variants (well, do you need some security or not? :-)): FTPS, SFTP, FTPS (they are different and unrelated) and HTTPS, but the software can be the same as for FTP and HTTP:
http://en.wikipedia.org/wiki/Application_layer[^],
http://en.wikipedia.org/wiki/File_Transfer_Protocol[^],
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol[^],
http://en.wikipedia.org/wiki/FTPS[^],
http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol[^],
http://en.wikipedia.org/wiki/HTTPS[^].
Everything can be implemented or already implemented for .NET. Apparently, listing of all of the libraries and classes would take too much room for this Quick Questions & Answers. The search of CodeProject along could give you enough of material, you just need to start.
There a many other, more exotic protocols and solutions — welcome to the world of open systems! After all, even the e-mail can be uses to transfer files, and even without the human operators.
But first, decide for yourself if you really want to transfer files. I have no reason to be sure you need exactly this. A file is not the only container of data available…—SA