摘要:
(1) 如果文件是可访问的web资源, <a href=""> 最简洁。(2) 如果是动态生成的资源:server端:response.setContentType("application/octet-stream;"); //Mime类型,随文件而变response.addHeader("Content-Disposition", "attachment;filename=\"" + URLEncoder.encode(responseFileName, "UTF-8" 阅读全文