{"id":15141897,"url":"https://github.com/rjarman/nativescript-filepicker","last_synced_at":"2025-08-28T08:17:25.278Z","repository":{"id":57687654,"uuid":"470841009","full_name":"rjarman/nativescript-filepicker","owner":"rjarman","description":"It's a flexible plugin for opening, selecting and copying any kind of file. Supports API 30.","archived":false,"fork":false,"pushed_at":"2022-04-18T12:23:34.000Z","size":50,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T08:38:43.872Z","etag":null,"topics":["android","filepicker","ios","nativescript","plugin"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rjarman.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":"2022-03-17T03:55:54.000Z","updated_at":"2024-05-30T16:31:58.000Z","dependencies_parsed_at":"2022-08-25T17:03:06.717Z","dependency_job_id":null,"html_url":"https://github.com/rjarman/nativescript-filepicker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rjarman/nativescript-filepicker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjarman%2Fnativescript-filepicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjarman%2Fnativescript-filepicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjarman%2Fnativescript-filepicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjarman%2Fnativescript-filepicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjarman","download_url":"https://codeload.github.com/rjarman/nativescript-filepicker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjarman%2Fnativescript-filepicker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272344442,"owners_count":24918038,"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-27T02:00:09.397Z","response_time":76,"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":["android","filepicker","ios","nativescript","plugin"],"created_at":"2024-09-26T09:20:23.029Z","updated_at":"2025-08-28T08:17:25.263Z","avatar_url":"https://github.com/rjarman.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# nativescript-filepickers ![apple](https://cdn3.iconfinder.com/data/icons/picons-social/57/16-apple-32.png) ![android](https://cdn4.iconfinder.com/data/icons/logos-3/228/android-32.png)\n\n\u003e Features\n\n- Supports **scoped storage**\n- Can **open** file from both external and app's internal storage\n- Can get **path** from both external and app's internal storage\n- Can **copy** files to internal storage\n- **nativescript-filepickers** plugin supporting both **single** and **multiple** selection.\n- Supports **any kinds of extensions**\n\n\u003e ***(NEW)*** @1.0.3\n\n- Show **just once** and **always** options while opening file with `OpenFile(path)`\n  Example:\n  ```typescript\n  import { CopyTo, Create, Extensions, Modes, OpenFile } from \"nativescript-filepickers\";\n\n  const context = Create({\n      extensions: ['pdf', 'xls'],\n      mode: Modes.Single,\n  });\n  context\n      .Authorize()\n      .then(() =\u003e {\n      return context.Present();\n      })\n      .then((assets) =\u003e {\n          assets.forEach((asset) =\u003e {\n              const newPath = CopyTo(asset);\n              OpenFile(newPath);\n              this.selectedImages.push(newPath);\n              console.log(\"Real Path: \" + asset);\n              console.log(\"Copied Path: \" + newPath);\n          });\n      });\n  ```\n\n\u003e Supported platforms\n\n| OS                           | Version                   |\n| ---------------------------- | ------------------------- |\n| Android 11                   | API 30                    |\n| Android 10(partially tested) | API 29(partially tested)  |\n| Android 9(partially tested)  | API 28(partially tested)  |\n| **IOS support is coming**    | **IOS support is coming** |\n\n\n\n```cli\nnpm i nativescript-filepickers\n```\n\n### Import the plugin\n\n_TypeScript_\n\n```typescript\nimport { CopyTo, Create, Extensions, Modes, OpenFile } from \"nativescript-filepickers\";\n```\n\n### Create filepicker\n\nCreate filepicker in `single` or `multiple` mode to specifiy if the filepicker will be used for single or multiple selection of images\n\n_TypeScript_\n\n```typescript\nconst context = Create({\n    extensions: ['pdf', 'xls'],\n    mode: Modes.Single,\n});\n```\n\n### Request permissions, show the images list and process the selection\n\n```typescript\ncontext\n    .Authorize()\n    .then(() =\u003e {\n    return context.Present();\n    })\n    .then((assets) =\u003e {\n        assets.forEach((asset) =\u003e {\n            const newPath = CopyTo(asset);\n            this.selectedImages.push(newPath);\n            console.log(\"Real Path: \" + asset);\n            console.log(\"Copied Path: \" + newPath);\n        });\n    });\n```\n\n\u003e **NOTE**: To request permissions for Android 6+ (API 23+) we use [nativescript-permissions](https://www.npmjs.com/package/nativescript-permissions).\n\n\u003e **NOTE**: To be sure to have permissions add the following lines in AndroidManifest.xml\n\n```xml\n\u003cmanifest ... \u003e\n\t\u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/\u003e\n\t\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/\u003e\n\t\u003cuses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\" /\u003e\n\n  \u003capplication android:requestLegacyExternalStorage=\"true\" ... \u003e\n    ...\n  \u003c/application\u003e\n\u003c/manifest\u003e\n```\n## API\n\n### Methods\n\n- `Create(options)` - creates instance of the filepicker. Possible options are:\n\n| Option     | Platform | Default        | Description                                                                                                                      |\n| ---------- | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| mode       | both     | `Modes.Single` | The mode if the filepicker. Possible values are `Modes.Single` for single selection and `Modes.Multiple` for multiple selection. |\n| extensions | both     | --             | Choose `Extensions.All` for accepting all types of files or explicitly define types array like `['pdf', 'xls', 'png']`           |\n\n- `Authorize()` - request the required permissions.\n- `Present()` - show the albums to present the user the ability to select files. Returns an array of the selected file's actual path on device.\n- `OpenFile(path: string, isAbsolute = false)` - It opens file from both app's internal storage and external storage if `isAbsolute` flag is `true`.\n- `CopyTo(path: string)` - It copied files from `path` to app's internal storage and returns the destination path.\n\n## License\n\nApache License Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjarman%2Fnativescript-filepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjarman%2Fnativescript-filepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjarman%2Fnativescript-filepicker/lists"}