Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何制作.exe文件的HTML下载链接?_Html_Executable_Downloadfile - Fatal编程技术网

如何制作.exe文件的HTML下载链接?

如何制作.exe文件的HTML下载链接?,html,executable,downloadfile,Html,Executable,Downloadfile,我正在建立一个网站,我想建立一个链接,人们可以下载一个名为test.exe的文件。我试过这样的方法: <a href=“test.exe” download></a> 但是没有人下载这个文件。它只是将我发送到一个不存在的页面。正确的写作方法是什么 (注意:test.exe位于我的桌面上)试试这个,它可以在我的网站上找到PDF文件。我不知道为什么它不应该与任何其他文件扩展名 <form method="get" action="te

我正在建立一个网站,我想建立一个链接,人们可以下载一个名为test.exe的文件。我试过这样的方法:

<a href=“test.exe” download></a>

但是没有人下载这个文件。它只是将我发送到一个不存在的页面。正确的写作方法是什么


(注意:test.exe位于我的桌面上)

试试这个,它可以在我的网站上找到PDF文件。我不知道为什么它不应该与任何其他文件扩展名

<form method="get" action="test.exe">
    <button type="submit">Download</button>
</form>

下载
请注意,“test.exe”需要与page.html位于同一目录中,或者需要定义路径,即“downloads/test.exe”。

您能试试吗

<a href="path/to/file.exe" target="_blank">Download Link </a>

我建议将EXE文件移动到存储.html文件的同一文件夹中

然后您可以使用:

<html>
<body>

    <a href="file.exe">Download my exe file</a>

</body>
</html>

为href属性添加完整路径,或者您可以将test.exe保存在源文件所在的同一文件夹中

<a href=“completepathtotestexe” download></a>


这应该行得通。您可以试试
download=“download”
。根据文件所在的位置,可能必须使用路径引用。右键单击“另存为”是否有效?test.exe必须位于文档根上方的目录中。谢谢,我现在将尝试所有选项。