imgcache.js icon indicating copy to clipboard operation
imgcache.js copied to clipboard

Using the cache with fileOpener2

Open mixmastamyk opened this issue 9 years ago • 2 comments

Hi, would you happen to know why this doesn't work? Can't seem to open any files I pass to the file opener. Other file types and operations with the urls in my app have worked, so not sure what the situation with pdfs is.


ImgCache.getCachedFileURL(url, function(original, cached) {
    console.log('** original: ' + original + '\ncached: ' + cached);

    cordova.plugins.fileOpener2.open(
        cached, 'application/pdf', {
            error : function(e) {
                console.log('Error status: ' + e.status + ' - Error message: ' + e.message);
            },
            success : function () {
                console.log('file opened successfully');
            }
        }
    );
});


mixmastamyk avatar Sep 19 '15 08:09 mixmastamyk

Btw, fileOpener2 says it is successful, but the pdf reader can't open the file, it says it can't access the file or something like that.

mixmastamyk avatar Sep 21 '15 16:09 mixmastamyk

How do I get the real path to the cached files? The two calls, getCachedFileURL, and getCachedFile don't provide this information, the give something like "/imgcache/...". This isn’t good enough, still haven't found the files. :(

mixmastamyk avatar Sep 22 '15 17:09 mixmastamyk