Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/lib/methods/helpers/fileDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

Expand All @@ -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<string, string> });
return file.uri;
};

Expand Down
Loading