通过Javascript下载FTP文件 [英] Download file from FTP via Javascript

查看:225
本文介绍了通过Javascript下载FTP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件服务器和一个Web服务器。它们运行在物理上不同的机器上。



我想通过JavaScript从FTP服务器下载文件。我必须通过JavaScript来完成的原因是我有一个外部应用程序,我只能将JavaScript注入到该应用程序中。



基本上,我需要指定ftp地址用户名和密码。但我关心安全性,因为人们可以查看FTP凭证。

实施这种情况的最佳方式是什么?



感谢您的帮助

问候

解决方案

Javascript只会说HTTP和WebSockets(在较新的浏览器上),而不是FTP。在这种情况下,将所有内容都保存在客户端,您可能必须编写一个处理实际FTP协议的Flash或Java小程序,并使用Javascript进行交互以提供交互性。



除非您打算将浏览器重定向到ftp站点,否则传递用户名和密码?您是否担心用户获取FTP信息,或者您是否在考虑嗅探纯文本FTP凭证的中间人攻击?


I have a got a file server and a web server. They are running on physically different machines.

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.

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?

Thanks for your help

Regards

解决方案

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.

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文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆