You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/03/06 05:24:08 UTC

[GitHub] [cordova-plugin-file-transfer] benazir0 opened a new issue #226: Downloaded PFD file disappears after few weeks

benazir0 opened a new issue #226: Downloaded PFD file disappears after few weeks
URL: https://github.com/apache/cordova-plugin-file-transfer/issues/226
 
 
   # Bug Report
   
   ## Problem
   Downloaded files disappears after few weeks
   ### What is expected to happen?
   Downloaded files stays on the persistent storage permanently on both Android and iOS platforms.
   
   
   ### What does actually happen?
   Downloaded file is not found after several days or weeks.
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   I have downloaded PDF files from a website and then store the locations of the filenames on the local storage. Then I use FileOpener plugin to open PDF files. After few weeks, the file-opener does not find some of the downloaded files and throws file not found error. I'm assuming the phone OS is removing the files for not being used frequently. I'm experiencing this issue for nearly 6 months or so. Please see the code snippet I use to download a pdf file.
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
     private downloadPDF(pdf: IPdf, callback: (data) => void) {
   
       const fileTransfer: FileTransferObject = this.transfer.create();
   
       fileTransfer.download(pdf.Location, this.file.dataDirectory + pdf.Name).then((entry) => {
   
         if (this.platform.is('android')) {
           this.filePath.resolveNativePath(entry.toURL())
             .then(filePath => {
               callback(filePath);
             })
             .catch(err => console.log(JSON.stringify(err)));
         }
         else {
           callback(entry.toURL());
         }
   
       }, (error) => {
         // handle error
       });
     }
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   I'm using Ionic Framework version 3.
   Platforms: Android and iOS
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   Ionic:
   
      ionic (Ionic CLI)  : 4.1.1
      Ionic Framework    : ionic-angular 3.6.0
      @ionic/app-scripts : 3.1.8
   
   Cordova:
   
      cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
      Cordova Platforms     : android 6.4.0
      Cordova Plugins       : no whitelisted plugins (18 plugins total)
   
   System:
   
      Android SDK Tools : 26.1.1 (C:\Users\[USERNAME]\AppData\Local\Android\sdk)
      NodeJS            : v6.11.3 (C:\Program Files\nodejs\node.exe)
      npm               : 6.5.0
      OS                : Windows 10
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org