<a id="downLink" href="" οnclick="downloadfile()" target="_blank" ></a>
function downloadfile() {
var id = $('#id').val();
var custDocFileVisitPath = $('#custDocFileVisitPath').val();
var filename = $('#filename').val();
var url = 'http://192.168.1.165:8081/customer/112/测试.png';
//var url = 'http://192.168.1.165:8081/customer/103/test.png';
if(id!=null && id!=''){
//window.open(encodeURI(encodeURI(url)));
document.getElementById("downLink").href = encodeURI(encodeURI(url));
}
}
如果是走服务端,并且文件路径有中文,需要在页面encodeURI(encodeURI(url));
String url= URLDecoder.decode(url,"UTF-8");