File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
isimip_data/metadata/assets/js/api Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -92,18 +92,13 @@ class DatasetApi {
9292
9393 static downloadFile ( file ) {
9494 if ( file . file_url ) {
95- fetch ( file . file_url )
96- . then ( response => response . blob ( ) )
97- . then ( blob => {
98- const url = URL . createObjectURL ( blob )
99- const a = document . createElement ( 'a' )
100- a . href = url
101- a . download = file . name
102- document . body . appendChild ( a )
103- a . click ( )
104- document . body . removeChild ( a )
105- URL . revokeObjectURL ( url )
106- } )
95+ const a = document . createElement ( 'a' )
96+ a . href = file . file_url + '?content_disposition=attachment'
97+ a . download = file . name
98+ a . rel = 'noopener noreferrer'
99+ document . body . appendChild ( a )
100+ a . click ( )
101+ document . body . removeChild ( a )
107102 }
108103 }
109104}
You can’t perform that action at this time.
0 commit comments