[英]How to create a downloadable zip file when we click on download button using javascript or jQuery or bootstrap
In my site i have requirement where we have couple of accordian titles.when a accrdian is expanded it should show a list of documents without download option and the document should have option of "add to" button..when we click the add to button/check box the document should be selected and the count should show beside the title of accordian..and we have one more download button at the bottom of all accordians..that final download section should show total count of all the selected documents from all the individual accordians and when we click on the download button the selected document/document s should be download as zip file.在我的网站上,我要求我们有几个手风琴标题。当展开手风琴时,它应该显示没有下载选项的文档列表,并且文档应该有“添加到”按钮选项。当我们单击添加到按钮时/check box 文档应该被选中并且计数应该显示在 accordian 的标题旁边..我们在所有 accordians 的底部还有一个下载按钮..最终的下载部分应该显示所有选定文档的总数个别手风琴,当我们单击下载按钮时,所选文档/文档应下载为 zip 文件。 And when no documents are selected the count should be zero and download button should be inactive...also in the accrdian for some documents there is requirement of deafault selection..can anyone please help me on this当没有选择任何文件时,计数应该为零并且下载按钮应该处于非活动状态......在某些文件的accrdian中也有默认选择的要求......任何人都可以帮助我解决这个问题
I am facing lot of issues while trying and I'm new to javascript.我在尝试时遇到了很多问题,而且我是 javascript 的新手。
When you create a link to a zip file like shown below the browser should automatically download it, maybe that helps you.当您创建指向如下所示的 zip 文件的链接时,浏览器应该会自动下载它,也许这对您有帮助。
<a target='_blank' href='/downloads/archive.zip'>Click here to download something!</a>
(By adding the target='_blank'
the link will be opened a new tab) (通过添加target='_blank'
链接将打开一个新选项卡)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.