title: How to open downloaded file (pdf,zip,docx, etc) in Phonegap app?
body: <p>Currently I am working on downloading module. Once user clicks download button, the file (either in pdf, zip file, or docx) will be downloaded from server and will be stored in local storage. I am able to download the file using FileTransfer.Download() method, but I can't open it by passing the file path.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name = "viewport" content = "user-scalable=no,width=device-width" /&gt;
      &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8"&gt;
      &lt;title&gt;Test Page&lt;/title&gt;
  &lt;script type="text/javascript" charset="utf-8" src="js/cordova-2.0.0.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
      &lt;style type="text/css"&gt;
          * {
              -webkit-tap-highlight-color: rgba(0, 0, 0, 0);  
          }
      &lt;/style&gt;
    &lt;script type="text/javascript" charset="utf-8"&gt;
        function init() {
            document.addEventListener("deviceready", ready, true);
        }
  
        function ready() {
            console.log("App is ready.");
        }
  
        function download() {
  
         //   var remoteFile = "https://dl.dropbox.com/u/6731723/a.zip";
            var remoteFile = "https://dl.dropbox.com/u/6731723/Beaver.pdf";
            var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/') + 1);
  
            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
                fileSystem.root.getFile(localFileName, { create: true, exclusive: false }, function (fileEntry) {
                    var localPath = fileEntry.fullPath;
                    console.log("localPath1:" + localPath);
                    if (device.platform === "Android" &amp;&amp; localPath.indexOf("file://") === 0) {
                        localPath = localPath.substring(7);
                    }
                    console.log("localPath2 save:" + localPath);
                    var ft = new FileTransfer();
                    ft.download(remoteFile,
                        localPath, function (entry) {
                            console.log("file path:" + entry.fullPath);
                            var linkopen = document.getElementById("openlink");
                            linkopen.style.display = "block";
                            linkopen.href = entry.fullPath;
  
                            // var dwnldImg = document.getElementById("dwnldImg");
                            //dwnldImg.src = entry.fullPath;
                            //dwnldImg.style.visibility = "visible";
                            //dwnldImg.style.display = "block";
                        }, fail);
                }, fail);
            }, fail);
        }
  
        function fail(error) {
            console.log("error:" + error.code);
        }
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="init();"&gt;
      &lt;a href="#" onclick="download();"&gt;Download file&lt;/a&gt;
  
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;a href="#" id="openlink" style="display:none;font-size:larger;"&gt;open&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>any idea how to get it work?</p>