Skip to content

Commit cb20cff

Browse files
committed
MOBILE-3401 fileuploader: Copy files to tmp folder when using chooser
1 parent dd0d36b commit cb20cff

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/core/fileuploader/providers/helper.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,16 @@ export class CoreFileUploaderHelperProvider {
8484
return Promise.reject(error);
8585
}
8686

87+
const options = this.fileUploaderProvider.getFileUploadOptions(result.uri, result.name, result.mediaType, true);
88+
8789
if (upload) {
8890
const size = await this.fileProvider.getExternalFileSize(result.uri);
8991

9092
await this.confirmUploadFile(size, false, allowOffline);
9193

92-
const options = this.fileUploaderProvider.getFileUploadOptions(result.uri, result.name, result.mediaType, true);
93-
9494
return this.uploadFile(result.uri, maxSize, true, options);
9595
} else {
96-
const entry = await this.fileProvider.getExternalFile(result.uri);
97-
98-
entry.name = result.name; // In Android sometimes the file is exported with a different name, use the original one.
99-
100-
return entry;
96+
return this.copyToTmpFolder(result.uri, false, maxSize, undefined, options);
10197
}
10298
}
10399

0 commit comments

Comments
 (0)