一般这个h5重新命名下载文件名称的属性没有生效,应该是后台的HTTP header设置了Content-Disposition了,
比如在python,在下载文件的时候写了如下代码:
resp.headers["Content-Type"] = "application/octet-stream"
resp.headers["Content-Disposition"] = "attachment; filename={0};".format(ret[1])
把Content-Disposition删除掉就可以了
当然这个功能只适合在同源下进行
If the HTTP header Content-Disposition: is present and gives a different filename than this attribute, the HTTP header has priority over this attribute.
If this attribute is present and Content-Disposition: is set to inline, Firefox gives priority to Content-Disposition, like for the filename case, while Chrome gives priority to the download attribute.
This attribute is only honored for links to resources with the same-origin.