{"id":4725,"url":"https://github.com/plrthink/react-native-file-download","last_synced_at":"2025-08-04T02:31:32.726Z","repository":{"id":57336972,"uuid":"41657492","full_name":"plrthink/react-native-file-download","owner":"plrthink","description":"[DEPRECATED] Native file download utility for react-native","archived":true,"fork":false,"pushed_at":"2016-06-14T05:56:31.000Z","size":182,"stargazers_count":47,"open_issues_count":0,"forks_count":10,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-07T09:32:02.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plrthink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-31T05:29:22.000Z","updated_at":"2023-01-28T21:26:46.000Z","dependencies_parsed_at":"2022-09-12T11:10:09.510Z","dependency_job_id":null,"html_url":"https://github.com/plrthink/react-native-file-download","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/plrthink/react-native-file-download","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plrthink%2Freact-native-file-download","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plrthink%2Freact-native-file-download/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plrthink%2Freact-native-file-download/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plrthink%2Freact-native-file-download/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plrthink","download_url":"https://codeload.github.com/plrthink/react-native-file-download/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plrthink%2Freact-native-file-download/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268639931,"owners_count":24282678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:21.425Z","updated_at":"2025-08-04T02:31:32.442Z","avatar_url":"https://github.com/plrthink.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["Backend"],"readme":"## This repo is deprecated in favor of [react-native-fs](https://github.com/johanneslumpe/react-native-fs#promise-downloadfileoptions)\n\n# React Native File Download [![react-native-file-download](http://img.shields.io/npm/dm/react-native-file-download.svg)](https://www.npmjs.org/package/react-native-file-download) [![npm version](https://badge.fury.io/js/react-native-file-download.svg)](https://badge.fury.io/js/react-native-file-download)\n\n\u003e Native file download utility for react-native\n\n##### *Note that does not support Android.*\n\n## Installation\n\n```bash\nnpm install react-native-file-download --save\n```\n\n## Getting started - iOS\n\n1. In Xcode, in the project navigator right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `react-native-file-download` and add `RNFileDownload.xcodeproj`\n3. Add `libRNFileDownload.a` (from 'Products' under RNFileDownload.xcodeproj) to your project's `Build Phases` ➜ `Link Binary With Libraries` phase\n4. Look for Header Search Paths and make sure it contains both `$(SRCROOT)/../react-native/React` and `$(SRCROOT)/../../React` - mark both as recursive\n5. Run your project (`CMD+R`)\n\n## Usage\n\nrequire it in your file\n\n```js\nconst FileDownload = require('react-native-file-download')\n```\n\nyou may also want to use something like [react-native-fs](https://github.com/johanneslumpe/react-native-fs) to access the file system (check its repo for more information)\n\n```js\nconst RNFS = require('react-native-fs')\n```\n\n## API\n\n**download(source: string, target: string): Promise**\n\n\u003e download file from source to target\n\nExample\n\n```js\nconst URL = '/path/to/remote/file'\nconst DEST = RNFS.DocumentDirectoryPath\nconst fileName = 'zip.zip'\nconst headers = {\n  'Accept-Language': 'en-US'\n}\n\nFileDownload.download(URL, DEST, fileName, headers)\n.then((response) =\u003e {\n  console.log(`downloaded! file saved to: ${response}`)\n})\n.catch((error) =\u003e {\n  console.log(error)\n})\n```\n\n**addListener(source: string, callback: function): EmitterSubscription**\n\n\u003e event listener for progress of download\n\nExample\n\n```js\nconst URL = '/path/to/remote/file'\nconst DEST = RNFS.DocumentDirectoryPath\nconst fileName = 'zip.zip'\nconst headers = {\n  'Accept-Language': 'en-US'\n}\n\nFileDownload.addListener(URL, (info) =\u003e {\n  console.log(`complete ${(info.totalBytesWritten / info.totalBytesExpectedToWrite * 100)}%`);\n});\n\nFileDownload.download(URL, DEST, fileName, headers)\n.then((response) =\u003e {\n  console.log(`downloaded! file saved to: ${response}`)\n})\n.catch((error) =\u003e {\n  console.log(error)\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplrthink%2Freact-native-file-download","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplrthink%2Freact-native-file-download","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplrthink%2Freact-native-file-download/lists"}