From 05945321262eab0b2e5f334257852f6f21e468d3 Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Sat, 30 Sep 2023 18:45:14 +0530 Subject: [PATCH] fix readFileAsync to extract type too --- src/libs/fileDownload/FileUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/fileDownload/FileUtils.js b/src/libs/fileDownload/FileUtils.js index cee2b8877ef6..e508d096128d 100644 --- a/src/libs/fileDownload/FileUtils.js +++ b/src/libs/fileDownload/FileUtils.js @@ -157,7 +157,7 @@ const readFileAsync = (path, fileName) => return res.blob(); }) .then((blob) => { - const file = new File([blob], cleanFileName(fileName)); + const file = new File([blob], cleanFileName(fileName), {type: blob.type}); file.source = path; // For some reason, the File object on iOS does not have a uri property // so images aren't uploaded correctly to the backend