如何从客户端复制 http 服务器上的文件?
过去,我使用 ftp 服务器,通过客户端的“ftp”连接和“GET”将一个文件从远程计算机复制到本地计算机。
是否可以做同样的事情,但服务器只运行一个 http 服务器?
服务器:GoAhead Web 服务器。
Windows 上的客户端和 http 服务器。
复制可以从浏览器启动,或者如果需要,可以在客户端上编写单独的程序。 (即 - 任何 Windows api 调用从 http 服务器复制文件?)
(此外,这些文件可能不在 http 根 Web 目录中,而是在服务器上的其他位置......会发生这种情况吗?)
In the past I used an ftp server, connected via "ftp" from the client and "GET" to copy one file from the remote machine to the local machine.
Is it possible to do the same but with the server only running a http server?
Server: GoAhead Web Server.
Both client and http server on Windows.
The copy can be either initiated from the browser or if need a separate program can be written on the client. (i.e. - any windows api calls to copy a file from http server?)
(Also, the files may not be in the http root web directory but somewhere else on the server....can that happen?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
HTTP 服务器将仅提供位于站点文档根目录内的文件。如果您想获取文档根目录之外的文件,则必须有一个脚本从服务器(php、perl、cgi 等)提供该文件,或者找到某种获取该文件的方法文档根目录“内部”。
要下载网站文档根目录中的文件,您只需点击指向该文件的 URL - 这是 HTTP 的核心点 - 您只需从网站下载内容。
如果没有中间脚本来处理,HTTP 服务器也不会接受上传。如果他们这样做了,你就可以将任何你想要的文件上传到任何地方的任何服务器。
HTTP servers will only serve up files that are located within the site's document root. If you want to get at files that are outside the document root, you'll have to have a script serve up that file from the server (php, perl, cgi, etc...), or find some way of getting that file "inside" the document root.
To download files within the site's document root, you just hit a url pointing at that file - that's the core point of HTTP - you're just downloading content from the site.
HTTP servers will also not accept uploads without an intermediate script to handle it. If they did, you could upload any file you wanted to any server, anywhere.
其他人提到的有关 HTTP 服务器的内容是正确的,但 GoAhead Web Server 不仅仅是一个 HTTP 服务器。除此之外,它还提供了许多其他功能。在补丁的帮助下,文件上传似乎是可能的。更多信息:
https://embedthis.com/goahead/
What others mentioned about HTTP servers is true, but GoAhead Web Server is not a only a HTTP server. It provides many other features on top of that. And file upload seems possible, with help of a patch. More info:
https://embedthis.com/goahead/
为此,请使用 WebDav。
Use WebDav for this purpose.