【发布时间】:2016-05-06 22:58:08
【问题描述】:
当我点击下载按钮时,它会链接到新的感谢网页,并在 2 秒后开始从 SD 卡下载 .csv 文件。
不是下载文件,而是显示在浏览器上。下面是我的代码。
如何每次都获得下载选项?请不要使用 php 代码,因为我是 html 新手。
我不想在 .csv 文件打开浏览器后使用另存为选项进行保存。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Monitoring System</title>
<link href="/mchp.css" rel="stylesheet" type="text/css" />
<script src="/mchp.js" type="text/javascript"></script>
</head>
<body>
<div id="shadow-one">
<div id="shadow-two">
<div id="shadow-three">
<div id="shadow-four">
<div id="page">
<div>
<div>
<div>
<div id="title">
<div class="right">Interface</div>
<div class="left">Overview</div>
</div>
<div id="content">
<h1>Monitoring System</h1>
<table style="padding-left: 10px;">
<div id="lcontent">
<div id="llogindiv" ><h1>Thanks for downloading...</h1></div>
<META HTTP-EQUIV="refresh" CONTENT="2;~GetEventFile~;";>
</table>
</div>
</div>
<div class="spacer"> </div>
<div id="footer">Copyright © Monitoring System</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
~GetEventFile~ 会在运行时给我文件名。
【问题讨论】: