Open MaximBelov opened 1 year ago
Hi @zfir My fix is working fine with
cordova-plugin-file v7.0.0
cordova-plugin-background-upload https://github.com/MaximBelov/cordova-plugin-background-upload/tree/compability-cordova-file-7
cordova-plugin-ionic-webview v5.0.0 https://github.com/ionic-team/cordova-plugin-ionic-webview
@awesome-cordova-plugins/ionic-webview https://github.com/danielsogl/awesome-cordova-plugins/blob/master/src/%40awesome-cordova-plugins/plugins/ionic-webview/index.ts
Example
// filePath - full path
// compatibleSrc - for view
getLocalFileParams(fileName: string) {
const filePath = `${this.file.dataDirectory}/${fileName}`;
const compatibleSrc = this.webview.convertFileSrc(filePath);
return {
filePath,
compatibleSrc,
};
}
const payload = {
fileKey: 'file',
notificationTitle: 'Uploading files',
id,
filePath: this.getLocalFileParams(file).filePath,
serverUrl: filesParams[id].attributes.action,
parameters: filesParams[id].inputs,
};
this.fileTransferManager.startUpload({ ...payload });
Hello @MaximBelov,
Tested your PR along with the update for cordova-plugin-file
to 7.0.0.
Still cannot display img
HTML tags
please share your demo project
It's a private project. Have you added img
HTML tags in your project?
yes I added img tags
<ion-img [src]="img.value"
https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/img/img.tsx#L115
You can check the demo project https://github.com/MaximBelov/cordova-plugin-background-upload/commits/compability-cordova-file-7-lab
android https://monosnap.com/file/XbQomCIDENc8KxuyczgPALPJLLNL9l
ios https://monosnap.com/file/1rTER5pa1sU6MfFONAMYT86mll8jrZ
Hello @MaximBelov,
For me, I am using img
and not ion-img
, maybe that's the problem.
Will look into that and merge if good.
Hello @MaximBelov,
Did some tests with ion-img
, not able to display the image still. Do you have a example where you are using ion-img
?
Hello @MaximBelov,
This version of cordova-plugin-file has a problem when displaying an img in the WebView.
https://github.com/apache/cordova-plugin-file/issues/526
The link above address this issue.