MOBILE-3401 fileuploader: Copy files to tmp folder when using chooser
parent
dd0d36b9a7
commit
cb20cff06d
|
@ -84,20 +84,16 @@ export class CoreFileUploaderHelperProvider {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const options = this.fileUploaderProvider.getFileUploadOptions(result.uri, result.name, result.mediaType, true);
|
||||||
|
|
||||||
if (upload) {
|
if (upload) {
|
||||||
const size = await this.fileProvider.getExternalFileSize(result.uri);
|
const size = await this.fileProvider.getExternalFileSize(result.uri);
|
||||||
|
|
||||||
await this.confirmUploadFile(size, false, allowOffline);
|
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);
|
return this.uploadFile(result.uri, maxSize, true, options);
|
||||||
} else {
|
} else {
|
||||||
const entry = await this.fileProvider.getExternalFile(result.uri);
|
return this.copyToTmpFolder(result.uri, false, maxSize, undefined, options);
|
||||||
|
|
||||||
entry.name = result.name; // In Android sometimes the file is exported with a different name, use the original one.
|
|
||||||
|
|
||||||
return entry;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue