
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
simple-file-upload-react
Advanced tools
React wrapper for the SimpleFileUpload web component with automatic script loading and optimal drag & drop support.
npm install simple-file-upload-react
import React from 'react';
import { SimpleFileUpload } from 'simple-file-upload-react';
function App() {
const handleFileChange = (event) => {
console.log('Files:', event.allFiles);
};
return (
<SimpleFileUpload
publicKey="YOUR_PUBLIC_KEY"
onChange={handleFileChange}
/>
);
}
import React, { useRef } from 'react';
import { SimpleFileUpload, SimpleFileUploadRef, FileChangeEvent } from 'simple-file-upload-react';
function App() {
const fileUploadRef = useRef<SimpleFileUploadRef>(null);
const handleFileChange = (event: FileChangeEvent) => {
console.log('Files:', event.allFiles);
};
const handleUploadDone = (event: FileChangeEvent) => {
console.log('Upload complete!', event.uploadedFiles);
};
const resetUploader = () => {
fileUploadRef.current?.reset();
};
return (
<>
<SimpleFileUpload
ref={fileUploadRef}
publicKey="YOUR_PUBLIC_KEY"
onChange={handleFileChange}
onUploadDone={handleUploadDone}
/>
<button onClick={resetUploader}>Reset</button>
</>
);
}
<SimpleFileUpload
publicKey="YOUR_PUBLIC_KEY"
buttonText="Upload Receipt"
onChange={handleFileChange}
/>
The component supports multiple languages. Set the locale prop to change all button text and error messages:
// Spanish
<SimpleFileUpload
publicKey="YOUR_PUBLIC_KEY"
locale="es"
onChange={handleFileChange}
/>
// Danish
<SimpleFileUpload
publicKey="YOUR_PUBLIC_KEY"
locale="da"
onChange={handleFileChange}
/>
Supported locales:
en - English (default)es - Spanishda - DanishThe component supports custom width and height through the style prop:
<SimpleFileUpload
publicKey="YOUR_PUBLIC_KEY"
style={{ width: '100%', height: '100px' }}
onChange={handleFileChange}
/>
<SimpleFileUpload
publicKey="YOUR_PUBLIC_KEY"
multiple={false}
buttonText="Upload Profile Photo"
style={{ width: '300px', height: '80px' }}
onChange={handleFileChange}
/>
Track the progress of file uploads with lifecycle event callbacks:
<SimpleFileUpload
publicKey="YOUR_PUBLIC_KEY"
onFileUploadInit={(event) => {
// Fires when files are selected, before uploading begins
console.log(`${event.totalCount} files selected:`, event.files);
}}
onFileUploadStart={(event) => {
// Fires when each individual file begins uploading
console.log(`Uploading file ${event.fileIndex + 1}/${event.totalCount}: ${event.fileName}`);
}}
onFileUploadFailed={(event) => {
// Fires when a file fails validation or upload
console.log(`Failed: ${event.fileName} - ${event.message}`);
}}
onChange={handleFileChange}
/>
| Prop | Type | Default | Description |
|---|---|---|---|
publicKey | string | required | Your Simple File Upload public API key |
tag | string | undefined | Optional tag to categorize uploads |
multiple | boolean | true | Whether to allow multiple file uploads |
maxFileSize | number | 5242880 (5MB) | Maximum file size in bytes |
maxFiles | number | 5 | Maximum number of files allowed |
accept | string | undefined | Accepted file types (e.g., "image/*,application/pdf") |
altText | boolean | false | Enable automatic alt-text generation for images |
locale | 'en' | 'es' | 'da' | 'en' | Locale for button text and error messages |
buttonText | string | undefined | Custom button text (overrides locale-based text) |
onChange | function | undefined | Callback when files change (added, removed, or upload complete) |
onFileUploadInit | function | undefined | Callback when files are selected, before uploading |
onFileUploadStart | function | undefined | Callback when each file begins uploading |
onFileUploadFailed | function | undefined | Callback when a file fails validation or upload |
onUploadDone | function | undefined | Callback when all uploads are complete |
onAltTextGenerated | function | undefined | Callback when alt-text is generated for an image |
onReset | function | undefined | Callback when component is reset |
className | string | undefined | Additional CSS class names |
style | React.CSSProperties | undefined | Additional inline styles (supports width/height for sizing) |
The component automatically:
ISC
FAQs
React wrapper for the SimpleFileUpload web component
We found that simple-file-upload-react demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.