OpenVPN export, fix download binary content, pass base64 to data: element. for https://github.com/opnsense/core/issues/2787

This commit is contained in:
Ad Schellevis 2018-11-20 19:59:44 +01:00
parent f3cb7e51ca
commit 53364c35ba

View File

@ -131,7 +131,7 @@
saveFormToEndpoint("/api/openvpn/export/download/"+vpnid+"/"+caref+"/",'frm_ExportSettings', function(data){
if (data.filename !== undefined) {
var link = $('<a></a>')
.attr('href','data:'+data.filetype+';charset=utf8,' + encodeURIComponent(atob(data.content)))
.attr('href','data:'+data.filetype+';base64,' + data.content)
.attr('download', data.filename)
.appendTo('body');