mostafa-mansour1 / previewAnyFile

Cordova Plugin to preview any file in native mode by providing the local or external URL
MIT License
33 stars 31 forks source link

Unable to view file stored at Azure Storage Explorer #29

Closed FrostyMint closed 3 years ago

FrostyMint commented 3 years ago

Hi I having trouble to preview file such as image and pdf using url from azure storage explorer that also contain with the SaS token, before that i did try using inAppBrowser which i able to view those file without problem. I did aso tested out using sample image from google which able to view the image using this previewAnyFile. Below attached image are the output i get after i launch the function Thanks. image image

   // jpgUrl = 'https://........blob.core.windows.net/...../Andy.jpg?sp=.......(SaStoken)';
  openImage(){
    this.previewAnyFile.preview(this.jpgUrl).then(()=>{

    },(err)=>{
      alert(JSON.stringify(err));
    })

  }
mostafa-mansour1 commented 3 years ago

You have to append the file name in the last of the URL or to pass the options

I need you to use the direct Cordova plugin, not ionic native because it has issues until they process my last pull request

be sure you are using the latest version of the plugin 0.2.7

use this code

 (<any>window).PreviewAnyFile.previewPath(
        win => console.log("open status",win),
        error => console.error("open failed", error),
        this.jpgUrl,{name : "Andy.jpg"}
    );
FrostyMint commented 3 years ago

@mostafa-mansour1 Alright, Thanks for the suggestion!