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:31:07 UTC

[GitHub] [cordova-plugin-file-transfer] benazir0 opened a new issue #227: Downloaded pdf files disappear after app rebuild on iOS platform

benazir0 opened a new issue #227: Downloaded pdf files disappear after app rebuild on iOS platform
URL: https://github.com/apache/cordova-plugin-file-transfer/issues/227
 
 
   # Bug Report
   
   ## Problem
   Downloaded PDF files disappear after an app rebuild on iOS platform
   ### What is expected to happen?
   Downloaded files stay on the persistent storage permanently on iOS platforms
   
   
   ### What does actually happen?
   Downloaded files are not found after an app rebuild on iOS platform.
   
   
   ## 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. Whenever I rebuild the app, the file-opener cannot find any of the files on iOS platform -on Android, it is fine. I'm experiencing this issue for nearly 6 months or so. It used to work before perfectly. 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