簡體   English   中英

如何從服務器下載文件並通過對話框保存

[英]How to download file from server and save it with dialog

我正在嘗試從目標server下載文件,收到文件后,我想打開一個對話框,然后選擇保存位置。

到目前為止,我僅用於簡單下載:

<a class="button" type="application/octet-stream"  href="http://localhost:5300/get" download>Click here for dld</a>

我已經讀到我需要使用FileApi來實現此目的,但是仍然不能在所有瀏覽器中使用。

我如何設法打開對話框?

只是用那個

<a href="data:application/octet-stream;charset=utf-8,your code here" download="filename.extension">Save as</a>

嘗試使用有助於處理下載操作的jquery.fileDownload.js

http://jqueryfiledownload.apphb.com/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM