使用命令行参数启动下载 [英] Initiating a download with command line arguments

查看:79
本文介绍了使用命令行参数启动下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从网页开始下载文件,因此用户将打开此文件以及某些命令行参数?

例如:

Is there a way to initiate a download of a file from a web page, so this file will be opened by the user along with certain command line arguments?
For example:

<iframe width="1" height="1" frameborder="0" src="myprogram.exe arg1 arg2"></iframe> 



(这不行,但只是为了澄清我的想法)



我是什么尝试过:



如你所见,我尝试使用iframe,只是在可执行路径的末尾添加了命令行参数。


(this won't work, but just to clarify my idea)

What I have tried:

As you can see I tried using iframe and just added the command line arguments at the end of the executable path.

推荐答案

不,这不会起作用,因为这是一个巨大的安全风险。您无法在客户端执行该文件。用户必须指定他们想要运行它,但到那时你的代码不再受控制。我建议寻找一种不同的方式来完成你需要的工作。
No, this will not work because it is a huge security risk. You cannot execute the file on the client side. The user has to specify that they want to run it but by then your code is no longer in control. I suggest looking for a different way to accomplish what you need.


你真的想要一次点击甚至在后台下载和执行文件吗?



这将是一场安全噩梦。



所以答案是:

没有这样做的方法。
Do you really want a file to be downloaded and executed with a single click or even in the background?

That would be a security nightmare.

So the answer is:
There is no way to do this.


这篇关于使用命令行参数启动下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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