MOBILE-3401 fileuploader: Copy files to tmp folder when using chooser

main
Dani Palou 2020-06-23 11:35:02 +02:00
parent dd0d36b9a7
commit cb20cff06d
1 changed files with 3 additions and 7 deletions

View File

@ -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);
}
}