在提交表单时,它应该下载文件并理想地重定向页面,这就是我正在尝试的
现在我正在使用hubspot表单我的代码看起来像这样只是提交表单并在表单提交时重定向到新页面。
<form accept-charset="UTF-8" enctype="multipart/form-data" id="hsForm_84b04dc8-4a51-44cc-aa1d-036709bd681f" class="hs-form stacked" action="https://forms.hubspot.com/uploads/form/v2/462167/84b04dc8-4a51-44cc-aa1d-036709bd681f" method="POST">
<h2>The Outsourcing Planning Template</h2>
<div class="col-md-6">
<input type="text" class="form-control" required="required" id="firstname-84b04dc8-4a51-44cc-aa1d-036709bd681f" name="firstname" placeholder="Name">
</div>
<div class="col-md-6">
<input type="email" class="form-control" required="required" id="email-84b04dc8-4a51-44cc-aa1d-036709bd681f" name="email" placeholder="Email Address">
</div>
<div class="hs_submit">
<div class="actions"><input class="btn btn-default" type="submit"></div>
</div>
</form>
现在下载pdf文件我修改了代码中的第3行,如下所示:
<div class="hs_submit">
<div class="actions"><input class="btn btn-default" href="http://cdn2.hubspot.net/hub/462167/file-2150080411-pdf/High_freq.pdf" type="submit" download></div>
</div>
从以下参考: How to trigger a file download when clicking an html button or javascript
同样提到How do I provide a direct download link to a PDF file?但是没有办法使用html或某些解决方案的下载标签吗? 提前致谢