# Ionic react file transfer download not working

**URL:** <https://forum.ionicframework.com/t/ionic-react-file-transfer-download-not-working/197732>\
**Category:** Ionic Framework\
**Created:** [October 12, 2020, 4:42am UTC](https://forum.ionicframework.com/t/ionic-react-file-transfer-download-not-working/197732 "2020-10-12T04:42:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![darix989](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@darix989](https://forum.ionicframework.com/u/darix989)\
**Post date:** [October 12, 2020, 4:42am UTC](https://forum.ionicframework.com/t/ionic-react-file-transfer-download-not-working/197732/1 "2020-10-12T04:42:34Z")

</div>

Hi there,  
I am trying to do a download using FileTransfer, but it gives me an error.

```auto
body: null
code: 3
exception: null
http_status: 401
source: "https://media3.giphy.com/media/LR0CgYz1CSmJ6PKiWW/giphy.gif"
target: "file:///storage/emulated/0/Download/test.gif"

```

I have read on the repo that code 3 means: FileTransferError.CONNECTION\_ERR  
But I am pretty sure the endpoint does not receive any request (I can notice this using another url pointing a local server).

This is my code (inside the main component of react).

```auto
const downloadFile = async () => {
    const fileTransfer = FileTransfer.create();
    let link = encodeURI("https://media3.giphy.com/media/LR0CgYz1CSmJ6PKiWW/giphy.gif");
    let path = File.externalRootDirectory + "Download/";
    let file_name = 'test.gif';
    let completePath = path + file_name;
    fileTransfer.download(link, completePath, true).then((entry) => {
      console.log(' download complete: ' + entry.toURL());
    }, (error) => {
      console.log("error ", error)
    });
  };

```

This is my setup:

React app + Ionic + Capacitor

This is the main part of my package.json:

```auto
"@capacitor/android": "^2.4.2",
"@capacitor/core": "2.4.2",
"@ionic-native/android-permissions": "^5.28.0",
"@ionic-native/core": "^5.28.0",
"@ionic-native/document-viewer": "^5.28.0",
"@ionic-native/file": "^5.28.0",
"@ionic-native/file-opener": "^5.28.0",
"@ionic-native/file-transfer": "^5.28.0",
"cordova-plugin-android-permissions": "^1.1.0",
"cordova-plugin-document-viewer": "^1.0.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener": "^1.0.0",
"cordova-plugin-file-transfer": "^1.7.1",
"react": "^16.13.0",

```

I suppose I am using Ionic 5 from the list on the package.json.

Any help?

---

<div class="post-metadata">

**Author:** ![darix989](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@darix989](https://forum.ionicframework.com/u/darix989)\
**Post date:** [October 13, 2020, 6:39pm UTC](https://forum.ionicframework.com/t/ionic-react-file-transfer-download-not-working/197732/2 "2020-10-13T18:39:01Z")

</div>

I have realized that this plugin is deprecated and not supported anymore, as it is published here:

> **[cordova-plugin-file-transfer](https://www.npmjs.com/package/cordova-plugin-file-transfer?fbclid=IwAR1n-wuqmnOTd-K6xnes4AQ6HSl55cIn1wprHH1eenvcMu4Q-gj0iYbTpUA)**
>
> Cordova File Transfer Plugin

“With the new features introduced in [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest), this plugin is not needed any more. Migrating from this plugin to using the new features of [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest), is explained in this [Cordova blog post](https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html).”
