以编程方式上传文件
我可以以编程方式将文件上传到服务器(不受客户端干扰)吗?我知道这在普通(.html)文件中是不可能的。无论如何,我可以从 .hta 文件中做到这一点吗?或任何服务器端或插件解决方案?
Can I programmatically upload a file to the server (without client's interference) ? I know this is not possible in normal (.html) files. Is there anyway I can do it from .hta file? or any server side or plug-gin solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从 HTA 中,您可以使用 shell 对象来运行命令,就像从命令行运行一样 - 包括 FTP - 但当然您需要 FTP 凭据。既然你说你将能够对要上传的文件进行硬编码,我假设你拥有完全访问权限......
from an HTA, you can use the shell object to run commands just as if you were running from the command line - including FTP - but of course you'll need FTP credentials. since you said you'll be able to hardcode the files to be uploaded, i assume you have full access...
简短的回答是否定的。
在一些机器上使用签名的java小程序可能是可能的 - 但从问题的措辞来看,这对你来说将是一个非常漫长的旅程。
Short answer is no.
It may be possible on some machines using a signed java applet - but from the wording of the question, that's going to be a very long juorney for you.
根据您最后的评论,您可能至少需要用户加载网页。因此,基于 onload 函数,您可以使用 ajax 隐藏表单来提交您想要的任何文件。
但在用户不知情的情况下获取信息可能会让您陷入法律困境。
祝你好运!!
Based on your last comment, you might atleast need the user to load a web page. So based on an onload function, you can use an ajax hidden form to submit whatever files that you'd want to.
But getting information from your user without their knowledge might put you in a legal situation.
Good luck!!