From cb20cff06de4f3ade71a8d301a35476e6e3f6301 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 23 Jun 2020 11:35:02 +0200 Subject: [PATCH] MOBILE-3401 fileuploader: Copy files to tmp folder when using chooser --- src/core/fileuploader/providers/helper.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core/fileuploader/providers/helper.ts b/src/core/fileuploader/providers/helper.ts index d2b4d07c5..c3a5d7d44 100644 --- a/src/core/fileuploader/providers/helper.ts +++ b/src/core/fileuploader/providers/helper.ts @@ -84,20 +84,16 @@ export class CoreFileUploaderHelperProvider { return Promise.reject(error); } + const options = this.fileUploaderProvider.getFileUploadOptions(result.uri, result.name, result.mediaType, true); + if (upload) { const size = await this.fileProvider.getExternalFileSize(result.uri); await this.confirmUploadFile(size, false, allowOffline); - const options = this.fileUploaderProvider.getFileUploadOptions(result.uri, result.name, result.mediaType, true); - return this.uploadFile(result.uri, maxSize, true, options); } else { - const entry = await this.fileProvider.getExternalFile(result.uri); - - entry.name = result.name; // In Android sometimes the file is exported with a different name, use the original one. - - return entry; + return this.copyToTmpFolder(result.uri, false, maxSize, undefined, options); } }