Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
react-uploader
Advanced tools
React File Upload UI Widget — Lightweight & supports: drag and drop, multiple uploads, image cropping, customization & more 🚀 Comes with Cloud Storage 🌐
React File Upload Component
(React Wrapper for Uploader)
To create a file upload button:
npm install react-uploader
import { Uploader } from "uploader";
import { UploadButton } from "react-uploader";
const uploader = new Uploader({
// Get production API keys from Upload.io
apiKey: "free"
});
<UploadButton uploader={uploader}
options={{multi: true}}
onComplete={files => console.log(files)}>
{({onClick}) =>
<button onClick={onClick}>
Upload a file...
</button>
}
</UploadButton>
Install via NPM:
npm install react-uploader
Or via YARN:
yarn add react-uploader
Or via a <script>
tag:
<script src="https://js.upload.io/react-uploader/v1"></script>
Initialize once at the start of your application:
import { Uploader } from "uploader";
// Get production API keys from Upload.io
const uploader = new Uploader({
apiKey: "free"
});
react-uploader
provides two UI components:
import { UploadButton } from "react-uploader";
<UploadButton uploader={uploader}
options={{multi: true}}
onComplete={files => console.log(files)}>
{({onClick}) =>
<button onClick={onClick}>
Upload a file...
</button>
}
</UploadButton>
import { UploadDropzone } from "react-uploader";
<UploadDropzone uploader={uploader}
options={{multi: true}}
onUpdate={files => console.log(files)}
width="600px"
height="375px" />
The onComplete
callback receives a Array<UploaderResult>
:
{
fileUrl: "https://upcdn.io/FW25...", // The URL to use when serving this file.
editedFile: undefined, // The edited file (if present). Same as below.
originalFile: {
accountId: "FW251aX", // The Upload.io account that owns the file.
file: { ... }, // DOM file object (from the <input> element).
fileId: "FW251aXa9ku...", // The uploaded file ID.
fileUrl: "https://upcdn.io/FW25...", // The uploaded file URL.
fileSize: 12345, // File size in bytes.
mime: "image/jpeg", // File MIME type.
suggestedOptimization: {
transformationUrl: "https://upcdn.io/..", // The suggested URL for serving this file.
transformationSlug: "thumbnail" // Append to 'fileUrl' to produce the above URL.
},
tags: [ // Tags manually & auto-assigned to this file.
{ name: "tag1", searchable: true },
{ name: "tag2", searchable: true },
...
]
}
}
react-uploader
is a React wrapper for uploader
.
Please see: Uploader Docs.
If you would like to contribute to Uploader:
FAQs
React File Upload UI Widget — Lightweight & supports: drag and drop, multiple uploads, image cropping, customization & more 🚀 Comes with Cloud Storage 🌐
The npm package react-uploader receives a total of 5,558 weekly downloads. As such, react-uploader popularity was classified as popular.
We found that react-uploader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.