updates
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user