title: Ionic copyFile error code 5, ENCODING_ERR
body: <p>I'm wondering, what is the problem.
  <code>this.file</code> - is the imported ionic native File plugin.</p>
  
  <pre><code>import { File } from '@ionic-native/file';
  
    constructor(
      ...
      private file: File,
      ...) {
      super();
    }
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>  // Copy the image to to the application storage directory
    private copyFileToLocalDir(imagePath, newFileName) {
      // Special handling for Android library
      const imageDir = imagePath.substr(imagePath.lastIndexOf('/') + 1);
      const fileName = imagePath.substr(0, imagePath.lastIndexOf('/') + 1);
  
      console.log('imagePath:');
      console.log(imagePath);
      console.log('imageDir:');
      console.log(imageDir);
      console.log('fileName:');
      console.log(fileName);
      console.log('this.file.dataDirectory:');
      console.log(this.file.dataDirectory);
      console.log('newFileName:');
      console.log(newFileName);
  
      this.file
        .copyFile(imageDir, fileName, this.file.dataDirectory, newFileName)
        .then(
          () =&gt; {
            this.uploadImage(newFileName);
          },
          (err) =&gt; {
            console.log('File save error:');
            console.log(err);
            this.notificationService.errorMessage('Ошибка сохранения файла');
          }
        );
    }
  </code></pre>
  
  <p>The otput:</p>
  
  <pre><code>imagePath:
  file:///storage/emulated/0/Android/data/io.ionic.starter/cache/1532935809457.jpg
  imageDir:
  1532935809457.jpg
  fileName:
  file:///storage/emulated/0/Android/data/io.ionic.starter/cache/
  this.file.dataDirectory:
  file:///data/user/0/io.ionic.starter/files/
  newFileName:
  1532935810087.jpg
  File save error:
  FileError
  code: 5
  message: "ENCODING_ERR"
  </code></pre>
  
  <p>The code was working before my big refactoring and before ionic CLI update. I were using Ionic v3.2.0 before, now it is v4.0.1</p>
  
  <p>What is the problem?</p>