{"id":16731410,"url":"https://github.com/skratchdot/react-file-processor","last_synced_at":"2025-04-10T11:20:53.456Z","repository":{"id":66198145,"uuid":"47728722","full_name":"skratchdot/react-file-processor","owner":"skratchdot","description":"A React component for choosing files","archived":false,"fork":false,"pushed_at":"2016-10-06T09:20:21.000Z","size":490,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T19:44:34.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://projects.skratchdot.com/react-file-processor","language":"JavaScript","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/skratchdot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-10T00:56:28.000Z","updated_at":"2018-03-27T18:30:22.000Z","dependencies_parsed_at":"2023-04-12T18:03:08.928Z","dependency_job_id":null,"html_url":"https://github.com/skratchdot/react-file-processor","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"ef55f2e837bd60fa9f2a947b2b3b9df1f0605789"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Freact-file-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Freact-file-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Freact-file-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Freact-file-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/react-file-processor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208602,"owners_count":21065203,"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","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-10-12T23:37:00.960Z","updated_at":"2025-04-10T11:20:53.436Z","avatar_url":"https://github.com/skratchdot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-file-processor\n\n[![NPM version](https://badge.fury.io/js/react-file-processor.svg)](http://badge.fury.io/js/react-file-processor)\n[![Dependency Status](https://david-dm.org/skratchdot/react-file-processor.svg)](https://david-dm.org/skratchdot/react-file-processor)\n[![devDependency Status](https://david-dm.org/skratchdot/react-file-processor/dev-status.svg)](https://david-dm.org/skratchdot/react-file-processor#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/react-file-processor.png)](https://npmjs.org/package/react-file-processor)\n\n\n## Description\n\nA React component that adds drag-and-drop functionality to the page it is included\non.  When files are dropped on the page, the onFileSelect() handler is called.\nYou can also trigger a chooseFile() method on the FileProcessor instance to open\nthe default browser's file picker.  This is useful for styling your own file\ninput button.\n\n\n## Getting Started\n\nInstall the module with: `npm install --save react-file-processor`\n\n\n## Usage\n\n```javascript\nimport React, { Component } from 'react';\nimport FileProcessor from 'react-file-processor';\nexport default class MyApp extends Component {\n  handleClick(e) {\n    this.refs.myFileInput.chooseFile();\n  }\n  handleFileSelect(e, files) {\n    console.log(e, files);\n  }\n  render() {\n    const self = this;\n    return (\n      \u003cdiv\u003e\n        \u003cheader\u003eMy Header\u003c/header\u003e\n        \u003cdiv\u003e\n          \u003cFileProcessor\n            ref=\"myFileInput\"\n            onFileSelect={self.handleFileSelect.bind(self)}\u003e\n            \u003cbutton onClick={self.handleClick.bind(handleClick)}\u003e\n              Open Local File\n            \u003c/button\u003e\n          \u003c/FileProcessor\u003e\n        \u003c/div\u003e\n        \u003cfooter\u003eMy Footer\u003c/footer\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n```\n\n\n## Documentation\n\n#### Props\n\nHere are the props you can pass to the `FileProcessor` instance:\n\n| Property Name | Type | Default Value | Description |\n|--------------:|:----:|:-------------:|-------------|\n| onFileSelect | Function | empty function | Called when files are dropped on the page, or when chooseFile() is triggered |\n| multiple | Boolean | false | Whether or not chooseFile() allows you to open multiple files or not |\n\n#### Exported Functions\n\nThe `FileProcessor` instance has a chooseFile() method attached to it. When\ntriggered, the browser's default file selector will show up.  After a file\nis chosen, the onFileSelect() prop is triggered with the file event, and the\nFileList that was chosen;\n\n\n## Links\n\n- [Source Code](https://github.com/skratchdot/react-file-processor/)\n- [Project Page](http://projects.skratchdot.com/react-file-processor/)\n- [Project Page Source](https://github.com/skratchdot/react-file-processor/tree/gh-pages)\n\n\n## License\nCopyright (c) 2015 [skratchdot](http://skratchdot.com/)  \nLicensed under the [MIT license](LICENSE-MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Freact-file-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Freact-file-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Freact-file-processor/lists"}