开发者

Is it possible to download a file given filepath using javascript/jquery?

开发者 https://www.devze.com 2022-12-27 15:47 出处:网络
I use json data with jquery... I have filepaths in json and i am i开发者_StackOverflowterating with jquery...

I use json data with jquery... I have filepaths in json and i am i开发者_StackOverflowterating with jquery...

var divs='';
$.each(jsob.Table, function(i, user) {
                divs += '<a class="download" href=' + user.resume_path + '/>'
            });
            $("#ResultsDiv").append(divs);

It works but how to make my anchor open file/save dialog box where the admin can download that resume... Any suggestion...


Whether or not a document triggers a file save dialog is dependent on how the browser handles that file type. If it's something the browser knows how to display, either natively or via a plugin of some sort, it will display in the browser. If not, then the user will be prompted to save the document.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号