Skip to content

Commit 4415a07

Browse files
fix: add headers to download the PDF (#6978)
1 parent 895ebf0 commit 4415a07

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/lib/methods/helpers/fileDownload.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import i18n from '../../../i18n';
77
import EventEmitter from './events';
88
import { Encryption } from '../../encryption';
99
import { sanitizeFileName } from '../handleMediaDownload';
10+
import { headers } from './fetch';
1011

1112
export const getLocalFilePathFromFile = (localPath: string, attachment: IAttachment): string => `${localPath}${attachment.title}`;
1213

@@ -18,7 +19,7 @@ export const fileDownload = async (url: string, attachment?: IAttachment, fileNa
1819
if (attachment?.title) {
1920
path = `${path}${sanitizeFileName(attachment.title)}`;
2021
}
21-
const file = await FileSystem.downloadAsync(url, path);
22+
const file = await FileSystem.downloadAsync(url, path, { headers: headers as Record<string, string> });
2223
return file.uri;
2324
};
2425

0 commit comments

Comments
 (0)