Download file from FTP via Javascript(通过 Javascript 从 FTP 下载文件)
问题描述
我有一个文件服务器和一个 Web 服务器.它们在物理上不同的机器上运行.
I have a got a file server and a web server. They are running on physically different machines.
我想通过 JavaScript 从 FTP 服务器下载一个文件.我必须通过 JavaScript 执行此操作的原因是我有一个外部应用程序,我只能将 JavaScript 注入该应用程序.
I would like to download a file from the FTP server via JavaScript. The reason I have to do it via JavaScript is that I have an external application and I can only inject JavaScript into that application.
基本上,我需要指定ftp地址用户名和密码.但我担心安全性,因为人们可以查看 FTP 凭据.
Basically, I need to specify ftp address username and password. But I am concerning about security as people can view FTP credentials.
实现这种情况的最佳方法是什么?
What is the best way to implement such scenario?
感谢您的帮助
问候
推荐答案
Javascript 只支持 HTTP 和 WebSockets(在较新的浏览器上),不支持 FTP.在这种情况下,将所有内容都保留在客户端,您可能必须编写一个 Flash 或 Java 小程序来处理实际的 FTP 协议,并与 Javascript 接口以提供交互性.
Javascript only speaks HTTP and WebSockets (on newer browsers), and not FTP. In that situation, keeping it all on the client-side, you'd probably have to write a Flash or Java applet that handles the actual FTP protocol, and interface with Javascript to provide interactivity.
除非您打算将浏览器重定向到 ftp 站点,并传入用户名和密码?您是否担心用户获取 FTP 信息,或者您是否担心嗅探明文 FTP 凭据的中间人攻击?
Unless you're planning on redirecting the browser to the ftp site, passing in the username and password? Are you concerned about the users getting the FTP information, or are you concerned with man-in-the-middle attacks sniffing the plaintext FTP credentials?
这篇关于通过 Javascript 从 FTP 下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:通过 Javascript 从 FTP 下载文件
![](/xwassets/images/pre.png)
![](/xwassets/images/next.png)
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Fetch API 如何获取响应体? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Flexslider 箭头未正确显示 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01