我想下载google drive上传的zip文件。以下是我的html代码供下载,
<a class="tlClogo" href="https://drive.google.com/open?id=0BzJrMJ44NPAEV1ZIRmk4VTdxbG8" id="downloadThisPage" oncontextmenu="return false;" download="myzip.zip"/>Click Here to download</a>
这是javascript,
<script type="text/javascript">
document.getElementById("downloadThisPage").href = window.location.toString();
</script>
答案 0 :(得分:0)
无需使用javascript anchor标签即可完成工作。你只需要改变这样的链接。
FROM:
<a class="tlClogo" href="https://drive.google.com/open?id=0BzJrMJ44NPAEV1ZIRmk4VTdxbG8" id="downloadThisPage" oncontextmenu="return false;" download="myzip.zip"/>Click Here to download</a>
TO:
<a class="tlClogo" href="https://drive.google.com/uc?export=download&confirm=SYSo&id=0BzJrMJ44NPAEV1ZIRmk4VTdxbG8">Click Here to download</a>