diff --git a/app/lib/methods/helpers/fileDownload.ts b/app/lib/methods/helpers/fileDownload.ts index 2c6f32ecd1..554ae0fbc8 100644 --- a/app/lib/methods/helpers/fileDownload.ts +++ b/app/lib/methods/helpers/fileDownload.ts @@ -7,6 +7,7 @@ import i18n from '../../../i18n'; import EventEmitter from './events'; import { Encryption } from '../../encryption'; import { sanitizeFileName } from '../handleMediaDownload'; +import { headers } from './fetch'; export const getLocalFilePathFromFile = (localPath: string, attachment: IAttachment): string => `${localPath}${attachment.title}`; @@ -18,7 +19,7 @@ export const fileDownload = async (url: string, attachment?: IAttachment, fileNa if (attachment?.title) { path = `${path}${sanitizeFileName(attachment.title)}`; } - const file = await FileSystem.downloadAsync(url, path); + const file = await FileSystem.downloadAsync(url, path, { headers: headers as Record }); return file.uri; };