# Unable to save a pdf file using ionic file transfer plugin

**URL:** <https://forum.ionicframework.com/t/unable-to-save-a-pdf-file-using-ionic-file-transfer-plugin/211318>\
**Category:** Ionic Framework\
**Created:** [June 19, 2021, 6:39pm UTC](https://forum.ionicframework.com/t/unable-to-save-a-pdf-file-using-ionic-file-transfer-plugin/211318 "2021-06-19T18:39:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Phani](https://avatars.discourse-cdn.com/v4/letter/_/f0a364/32.png) [@\_Phani](https://forum.ionicframework.com/u/_Phani)\
**Post date:** [June 19, 2021, 6:39pm UTC](https://forum.ionicframework.com/t/unable-to-save-a-pdf-file-using-ionic-file-transfer-plugin/211318/1 "2021-06-19T18:39:00Z")

</div>

I m using ionic 5+ and using ionic file transfer plugin for downloading a pdf file but whenever i m downloading a file im facing 2 issues

1. When ever im building a project i need to manually remove the deprecated one to this  
` public class FileProvider extends androidx.core.content.FileProvider`

2. After i changing this and ran the application im getting 401 error

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/c/5/c50a64f58160f8b9a93c2c91f78da883b6da3f54.png)

below is my code

```auto
pdfUrl = 'https://www.cs.toronto.edu/~hinton/absps/NatureDeepReview.pdf';

  constructor(private transfer: FileTransfer, private file: File) {}

  download() {

    const fileTransfer: FileTransferObject = this.transfer.create();

    const url = this.pdfUrl;

  fileTransfer.download(url, this.file.dataDirectory).then((entry) => {

    console.log('download complete: ' + entry.toURL());

    this.saveData = entry.toURL();

  }, (error) => {

    // handle error

    console.log(error);

  });

```

is there any alternative for this and if i want to use capacitor where can get a sample related file download
