|
|
|
@ -6,15 +6,9 @@ export interface DownloadUrlItem { |
|
|
|
} |
|
|
|
|
|
|
|
export function downloadFile(fileUrl: string, fileName: string): void { |
|
|
|
if (fileUrl.indexOf('www.popi.art/media') >= 0 |
|
|
|
|| fileUrl.indexOf('localhost:8080/media') >= 0 |
|
|
|
|| fileUrl.indexOf('localhost:4200/media') >= 0) { |
|
|
|
if (fileUrl.indexOf('?') >= 0) { |
|
|
|
fileUrl += '&download=true' |
|
|
|
} else { |
|
|
|
fileUrl += '?download=true'; |
|
|
|
} |
|
|
|
} |
|
|
|
// if (fileUrl.includes('/media') && !fileUrl.startsWith('blob:')) {
|
|
|
|
// fileUrl += fileUrl.includes('?') ? '&download=true' : '?download=true';
|
|
|
|
// }
|
|
|
|
const a = document.createElement('a'); |
|
|
|
a.style.display = 'none'; |
|
|
|
a.href = fileUrl; |
|
|
|
|