admin管理员组

文章数量:1316974

$.get(
url: downloadUrl,
function(data) {

//after get the data, how to ask browser pop up to save file?
}
); 

data is content dumped by server side servlet. can be binary

$.get(
url: downloadUrl,
function(data) {

//after get the data, how to ask browser pop up to save file?
}
); 

data is content dumped by server side servlet. can be binary

Share Improve this question asked Mar 4, 2011 at 14:13 ettaetta 35.8k84 gold badges220 silver badges329 bronze badges 3
  • Does this have to be done in AJAX rather than just linking to the file? – iivel Commented Mar 4, 2011 at 14:15
  • the purpose of doing ajax get is need to put some custom header before do get – etta Commented Mar 4, 2011 at 14:16
  • Hi, can you please explain how you fixed this.. ? – ria Commented Apr 2, 2013 at 3:47
Add a ment  | 

1 Answer 1

Reset to default 8

Don't use Ajax for this, just location = downloadUrl;

本文标签: javascriptjquery ajax get download fileStack Overflow