Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with cordova-plugin-file v7.0.0 #252

Conversation

MaximBelov
Copy link
Contributor

No description provided.

@MaximBelov MaximBelov changed the title compatibility with cordova-plugin-file 7 compatibility with cordova-plugin-file v7.0.0 Nov 23, 2022
@zfir
Copy link
Member

zfir commented Nov 23, 2022

Hello @MaximBelov,

This version of cordova-plugin-file has a problem when displaying an img in the WebView.

apache/cordova-plugin-file#526

The link above address this issue.

@MaximBelov
Copy link
Contributor Author

Hi @zfir
My fix is working fine with

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

@zfir
Copy link
Member

zfir commented Nov 25, 2022

Hello @MaximBelov,

Tested your PR along with the update for cordova-plugin-file to 7.0.0.

Still cannot display img HTML tags

@MaximBelov
Copy link
Contributor Author

please share your demo project

@zfir
Copy link
Member

zfir commented Nov 25, 2022

It's a private project. Have you added img HTML tags in your project?

@zfir
Copy link
Member

zfir commented Nov 25, 2022

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.

@zfir
Copy link
Member

zfir commented Nov 28, 2022

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?

@MaximBelov
Copy link
Contributor Author

@MaximBelov MaximBelov marked this pull request as ready for review April 30, 2024 11:32
@MaximBelov MaximBelov closed this Oct 2, 2024
@MaximBelov MaximBelov deleted the compability-cordova-file-7 branch October 2, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants