Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Open local file in InAppBrowser? Or how to save file to main iOS menu directory?

$
0
0

I'm using the file-transfer cordova plugin to download files and InAppBrowser to view remote ones, but I'm not able to:

  1. Save the file to the correct location (as in the main menu screen on iOS) using file-transfer

    let targetPath = cordova.file.syncedDataDirectory + file;
    fileTransfer.download(fileLocation, targetPath, (res) => {
      // manipulate the file etc
    }

syncedDataDirectory is obviously the wrong path, but documentsDirectory doesn't store the file anywhere useful for the user either. The files are saving but I need them in a place the user can open them up in iBooks etc.

  1. Display a local file in InAppBrowser (something to do with safari sandboxing my files?)

    this.platform.ready().then(() => {
        cordova.InAppBrowser.open(url, "_system", "location=true");
    });

Safari will simply not let me display local files. Surely there must be a way?

I don't mind which one (although i'd like to know what users would prefer themselves), I just want to find a solution for either.


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>