This commit is contained in:
2025-06-10 15:33:01 +02:00
parent 9af9977749
commit 4579b35fe0
2 changed files with 64 additions and 2 deletions

View File

@@ -623,13 +623,15 @@ const downloadFile = async (file: FileItem) => {
// Check if Safari (iOS or desktop)
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
const bucket = file.bucket || 'client-portal';
if (isSafari) {
// For Safari, open in new window to force proper filename handling
const downloadUrl = `/api/files/proxy-download?fileName=${encodeURIComponent(file.name)}`;
const downloadUrl = `/api/files/proxy-download?fileName=${encodeURIComponent(file.name)}&bucket=${bucket}`;
window.location.href = downloadUrl;
} else {
// For other browsers, use blob approach
const response = await fetch(`/api/files/proxy-download?fileName=${encodeURIComponent(file.name)}`);
const response = await fetch(`/api/files/proxy-download?fileName=${encodeURIComponent(file.name)}&bucket=${bucket}`);
if (!response.ok) {
throw new Error('Failed to download file');
@@ -714,6 +716,7 @@ const deleteSelected = async () => {
body: {
fileName: item.name,
isFolder: item.isFolder,
bucket: item.bucket || 'client-portal',
},
});
successCount++;