Top Related Projects
A pure JavaScript client for the tus resumable upload protocol
File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.
Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.
Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
Simple HTML5 drag-drop zone with React.js.
Promise based HTTP client for the browser and node.js
Quick Overview
Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly with any application. It's designed to be fast, easy to use, and customizable, allowing developers to create a smooth file uploading experience for their users. Uppy works with various sources, including local disk, remote URLs, Google Drive, Dropbox, and more.
Pros
- Highly modular and extensible architecture
- Supports a wide range of file sources and upload destinations
- Provides a user-friendly interface with drag-and-drop functionality
- Offers progress bars, previews, and resumable uploads
Cons
- Can be overkill for simple upload needs
- Requires additional setup for certain integrations (e.g., cloud storage providers)
- May have a steeper learning curve compared to simpler upload solutions
- Bundle size can be large if using many plugins
Code Examples
- Basic usage with local file selection:
import Uppy from '@uppy/core'
import Dashboard from '@uppy/dashboard'
import XHRUpload from '@uppy/xhr-upload'
const uppy = new Uppy()
.use(Dashboard, { inline: true, target: '#uppy-dashboard' })
.use(XHRUpload, { endpoint: 'https://your-domain.com/upload' })
uppy.on('complete', (result) => {
console.log('Upload complete! We've uploaded these files:', result.successful)
})
- Adding Dropbox integration:
import Dropbox from '@uppy/dropbox'
uppy.use(Dropbox, { companionUrl: 'https://companion.uppy.io' })
- Implementing custom file validation:
uppy.use(Dashboard, {
inline: true,
target: '#uppy-dashboard',
onBeforeFileAdded: (currentFile, files) => {
if (currentFile.size > 1000000) {
uppy.info('File is too large, please select a file smaller than 1MB', 'error', 5000)
return false
}
return true
}
})
Getting Started
- Install Uppy and required plugins:
npm install @uppy/core @uppy/dashboard @uppy/xhr-upload
- Import and initialize Uppy in your JavaScript file:
import Uppy from '@uppy/core'
import Dashboard from '@uppy/dashboard'
import XHRUpload from '@uppy/xhr-upload'
const uppy = new Uppy()
.use(Dashboard, { inline: true, target: '#uppy-dashboard' })
.use(XHRUpload, { endpoint: 'https://your-domain.com/upload' })
uppy.on('complete', (result) => {
console.log('Upload complete!', result.successful)
})
- Add the necessary HTML element to your page:
<div id="uppy-dashboard"></div>
Competitor Comparisons
A pure JavaScript client for the tus resumable upload protocol
Pros of tus-js-client
- Lightweight and focused solely on resumable file uploads
- Implements the tus protocol, ensuring compatibility with tus servers
- Can be used as a standalone library or integrated into larger projects
Cons of tus-js-client
- Limited features compared to Uppy's comprehensive file upload solution
- Requires more manual configuration and setup for advanced use cases
- Less extensive UI components and customization options
Code Comparison
tus-js-client:
const upload = new tus.Upload(file, {
endpoint: "https://tusd.tusdemo.net/files/",
retryDelays: [0, 3000, 5000, 10000, 20000],
metadata: {
filename: file.name,
filetype: file.type
},
onError: function(error) {
console.log("Failed because: " + error)
},
onProgress: function(bytesUploaded, bytesTotal) {
var percentage = (bytesUploaded / bytesTotal * 100).toFixed(2)
console.log(bytesUploaded, bytesTotal, percentage + "%")
},
onSuccess: function() {
console.log("Download %s from %s", upload.file.name, upload.url)
}
})
Uppy:
const uppy = new Uppy()
.use(Dashboard, { inline: true, target: '#drag-drop-area' })
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
uppy.on('complete', (result) => {
console.log('Upload complete! We've uploaded these files:', result.successful)
})
File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.
Pros of jQuery-File-Upload
- Lightweight and easy to integrate with existing jQuery-based projects
- Extensive browser support, including older versions
- Built-in image resizing and orientation correction features
Cons of jQuery-File-Upload
- Relies on jQuery, which may not be ideal for modern JavaScript frameworks
- Less actively maintained compared to Uppy
- Limited built-in UI components and customization options
Code Comparison
jQuery-File-Upload:
$('#fileupload').fileupload({
url: '/upload',
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo(document.body);
});
}
});
Uppy:
const uppy = new Uppy()
.use(Dashboard, { inline: true, target: '#drag-drop-area' })
.use(XHRUpload, { endpoint: '/upload' })
uppy.on('complete', (result) => {
console.log('Upload complete! We've uploaded these files:', result.successful)
})
The jQuery-File-Upload example shows a more traditional jQuery-based approach, while Uppy demonstrates a modern, modular structure with a plugin system. Uppy's code is more declarative and offers a cleaner API for handling uploads and events.
Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.
Pros of Fine Uploader
- More mature project with longer history and established user base
- Supports a wider range of server-side technologies out of the box
- Offers more granular control over the upload process
Cons of Fine Uploader
- Less modern UI and design compared to Uppy
- Steeper learning curve for beginners
- Not as actively maintained as Uppy in recent years
Code Comparison
Fine Uploader:
var uploader = new qq.FineUploader({
element: document.getElementById('uploader'),
request: {
endpoint: '/uploads'
}
});
Uppy:
const uppy = new Uppy()
.use(Dashboard, { trigger: '#select-files' })
.use(XHRUpload, { endpoint: '/uploads' })
uppy.on('complete', (result) => {
console.log('Upload complete! We've uploaded these files:', result.successful)
})
Both libraries provide easy-to-use APIs for implementing file uploads, but Uppy's modern syntax and plugin-based architecture make it more approachable for developers familiar with contemporary JavaScript practices. Fine Uploader offers more configuration options out of the box, which can be beneficial for complex use cases but may be overwhelming for simpler implementations.
Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
Pros of Dropzone
- Lightweight and simple to use, with minimal setup required
- Extensive customization options for appearance and behavior
- Well-established project with a large community and long-term stability
Cons of Dropzone
- Limited built-in features compared to Uppy's comprehensive toolkit
- Lacks advanced capabilities like webcam support or integration with cloud storage services
- Less actively maintained, with slower release cycles
Code Comparison
Dropzone initialization:
Dropzone.options.myDropzone = {
url: "/file/post",
maxFilesize: 2,
acceptedFiles: ".jpeg,.jpg,.png,.gif"
};
Uppy initialization:
const uppy = new Uppy()
.use(Dashboard, { inline: true, target: '#drag-drop-area' })
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
.use(XHRUpload, { endpoint: 'https://my-xhr-endpoint.com' });
Key Differences
- Uppy offers a more modern and feature-rich approach to file uploading
- Dropzone focuses on simplicity and ease of use for basic file upload needs
- Uppy provides a plugin-based architecture for extensibility, while Dropzone relies on configuration options
- Uppy includes built-in support for various upload protocols and cloud services, whereas Dropzone primarily handles XHR uploads
Both libraries are popular choices for file uploading in web applications, with Dropzone being more suitable for simpler use cases and Uppy offering a more comprehensive solution for complex file handling requirements.
Simple HTML5 drag-drop zone with React.js.
Pros of react-dropzone
- Lightweight and focused solely on drag-and-drop file uploading
- Easy integration with React applications
- Highly customizable with extensive props and callbacks
Cons of react-dropzone
- Limited built-in UI components and styling options
- Requires additional libraries for advanced features like progress tracking and file processing
- Less comprehensive documentation compared to Uppy
Code Comparison
react-dropzone:
import { useDropzone } from 'react-dropzone';
function MyDropzone() {
const { getRootProps, getInputProps } = useDropzone();
return (
<div {...getRootProps()}>
<input {...getInputProps()} />
<p>Drag 'n' drop some files here, or click to select files</p>
</div>
);
}
Uppy:
import Uppy from '@uppy/core';
import { Dashboard } from '@uppy/react';
const uppy = new Uppy();
function MyUploader() {
return <Dashboard uppy={uppy} />;
}
react-dropzone provides a more minimalistic approach, offering a hook-based API for easy integration with React components. It focuses solely on the drag-and-drop functionality, allowing developers to build custom UI around it.
Uppy, on the other hand, offers a more comprehensive solution with built-in UI components and a wider range of features out of the box. It provides a plugin-based architecture for extensibility and a more opinionated approach to file uploading.
Promise based HTTP client for the browser and node.js
Pros of Axios
- Simpler and more lightweight, focused solely on HTTP requests
- Wider browser support, including older versions
- Built-in request and response interceptors
Cons of Axios
- Limited to HTTP requests, no file upload UI or advanced features
- Requires additional libraries for more complex operations
- Less opinionated, which may lead to inconsistent usage across projects
Code Comparison
Axios:
axios.get('/user?ID=12345')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
Uppy:
const uppy = new Uppy()
.use(XHRUpload, { endpoint: 'https://example.com/upload' })
.on('complete', (result) => {
console.log('Upload complete! We've uploaded these files:', result.successful)
})
Summary
Axios is a popular, lightweight HTTP client for browser and Node.js environments, focusing on simplicity and ease of use for making API requests. It offers wide browser support and built-in features like interceptors.
Uppy, on the other hand, is a more comprehensive file upload library with a rich UI and advanced features. It's specifically designed for handling file uploads and provides a more opinionated structure.
While Axios excels in simple HTTP requests, Uppy offers a more complete solution for file uploads with additional features like progress tracking, resumable uploads, and a plugin system. The choice between the two depends on the specific needs of your project, with Axios being more suitable for general API interactions and Uppy for complex file upload scenarios.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Uppy
Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly with any application. Itâs fast, has a comprehensible API and lets you worry about more important problems than building a file uploader.
- Fetch files from local disk, remote URLs, Google Drive, Dropbox, Box, Instagram or snap and record selfies with a camera
- Preview and edit metadata with a nice interface
- Upload to the final destination, optionally process/encode
Uppy is being developed by the folks at Transloadit, a versatile API to handle any file in your app.
Tests | |||
---|---|---|---|
Deploys |
Example
Code used in the above example:
import Uppy from '@uppy/core'
import Dashboard from '@uppy/dashboard'
import RemoteSources from '@uppy/remote-sources'
import ImageEditor from '@uppy/image-editor'
import Webcam from '@uppy/webcam'
import Tus from '@uppy/tus'
const uppy = new Uppy()
.use(Dashboard, { trigger: '#select-files' })
.use(RemoteSources, { companionUrl: 'https://companion.uppy.io' })
.use(Webcam)
.use(ImageEditor)
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
.on('complete', (result) => {
console.log('Upload result:', result)
})
Try it online or read the docs for more details on how to use Uppy and its plugins.
Features
- Lightweight, modular plugin-based architecture, light on dependencies :zap:
- Resumable file uploads via the open tus standard, so large uploads survive network hiccups
- Supports picking files from: Webcam, Dropbox, Box, Google Drive, Instagram, bypassing the userâs device where possible, syncing between servers directly via @uppy/companion
- Works great with file encoding and processing backends, such as Transloadit, works great without (all you need is to roll your own Apache/Nginx/Node/FFmpeg/etc backend)
- Sleek user interface :sparkles:
- Optional file recovery (after a browser crash) with Golden Retriever
- Speaks several languages (i18n) :earth_africa:
- Built with accessibility in mind
- Free for the world, forever (as in beer ðº, pizza ð, and liberty ð½)
- Cute as a puppy, also accepts cat pictures :dog:
Installation
npm install @uppy/core @uppy/dashboard @uppy/tus
Add CSS
uppy.min.css,
either to your HTML pageâs <head>
or include in JS, if your bundler of choice
supports it.
Alternatively, you can also use a pre-built bundle from Transloaditâs CDN:
Edgly. In that case Uppy
will attach itself to the global window.Uppy
object.
â ï¸ The bundle consists of most Uppy plugins, so this method is not recommended for production, as your users will have to download all plugins when you are likely using only a few.
<!-- 1. Add CSS to `<head>` -->
<link
href="https://releases.transloadit.com/uppy/v4.3.0/uppy.min.css"
rel="stylesheet"
/>
<!-- 2. Initialize -->
<div id="files-drag-drop"></div>
<script type="module">
import {
Uppy,
Dashboard,
Tus,
} from 'https://releases.transloadit.com/uppy/v4.3.0/uppy.min.mjs'
const uppy = new Uppy()
uppy.use(Dashboard, { target: '#files-drag-drop' })
uppy.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
</script>
Documentation
- Uppy â full list of options, methods and events
- Companion â setting up and running a Companion instance, which adds support for Instagram, Dropbox, Box, Google Drive and remote URLs
- React â components to integrate Uppy UI plugins with React apps
- Architecture & Writing a Plugin â how to write a plugin for Uppy
Plugins
UI Elements
Dashboard
â universal UI with previews, progress bars, metadata editor and all the cool stuff. Required for most UI plugins like Webcam and InstagramProgress Bar
â minimal progress bar that fills itself when upload progressesStatus Bar
â more detailed progress, pause/resume/cancel buttons, percentage, speed, uploaded/total sizes (included by default withDashboard
)Informer
â send notifications like âsmileâ before taking a selfie or âupload failedâ when all is lost (also included by default withDashboard
)
Sources
Drag & Drop
â plain drag and drop areaFile Input
â even plainer âselect filesâ buttonWebcam
â snap and record those selfies ð·- â
Google Drive
â import files from Google Drive - â
Dropbox
â import files from Dropbox - â
Box
â import files from Box - â
Instagram
â import images and videos from Instagram - â
Facebook
â import images and videos from Facebook - â
OneDrive
â import files from Microsoft OneDrive - â
Import From URL
â import direct URLs from anywhere on the web
The â mark means that @uppy/companion
, a
server-side component, is needed for a plugin to work.
Destinations
Tus
â resumable uploads via the open tus standardXHR Upload
â regular uploads for any backend out there (like Apache, Nginx)AWS S3
â plain upload to AWS S3 or compatible servicesAWS S3 Multipart
â S3-style âMultipartâ upload to AWS or compatible services
File Processing
Transloadit
â support for Transloaditâs robust file uploading and encoding backend
Miscellaneous
Golden Retriever
â restores files after a browser crash, like itâs nothingThumbnail Generator
â generates image previews (included by default withDashboard
)Form
â collects metadata from<form>
right before an Uppy upload, then optionally appends results back to the formRedux
â for your emerging time traveling needs
React
- React â components to integrate Uppy UI plugins with React apps
- React Native â basic Uppy component for React Native with Expo
Browser Support
We aim to support recent versions of Chrome, Firefox, and Safari.
FAQ
Why not use <input type="file">
?
Having no JavaScript beats having a lot of it, so thatâs a fair question! Running an uploading & encoding business for ten years though we found that in cases, the file input leaves some to be desired:
- We received complaints about broken uploads and found that resumable uploads are important, especially for big files and to be inclusive towards people on poorer connections (we also launched tus.io to attack that problem). Uppy uploads can survive network outages and browser crashes or accidental navigate-aways.
- Uppy supports editing meta information before uploading.
- Uppy allows cropping images before uploading.
- Thereâs the situation where people are using their mobile devices and want to upload on the go, but they have their picture on Instagram, files in Dropbox or a plain file URL from anywhere on the open web. Uppy allows to pick files from those and push it to the destination without downloading it to your mobile device first.
- Accurate upload progress reporting is an issue on many platforms.
- Some file validation â size, type, number of files â can be done on the client with Uppy.
- Uppy integrates webcam support, in case your users want to upload a picture/video/audio that does not exist yet :)
- A larger drag and drop surface can be pleasant to work with. Some people also like that you can control the styling, language, etc.
- Uppy is aware of encoding backends. Often after an upload, the server needs to rotate, detect faces, optimize for iPad, or what have you. Uppy can track progress of this and report back to the user in different ways.
- Sometimes you might want your uploads to happen while you continue to interact on the same single page.
Not all apps need all these features. An <input type="file">
is fine in many
situations. But these were a few things that our customers hit / asked about
enough to spark us to develop Uppy.
Why is all this goodness free?
Transloaditâs team is small and we have a shared ambition to make a living from open source. By giving away projects like tus.io and Uppy, weâre hoping to advance the state of the art, make life a tiny little bit better for everyone and in doing so have rewarding jobs and get some eyes on our commercial service: a content ingestion & processing platform.
Our thinking is that if only a fraction of our open source userbase can see the appeal of hosted versions straight from the source, that could already be enough to sustain our work. So far this is working out! Weâre able to dedicate 80% of our time to open source and havenât gone bankrupt yet. :D
Does Uppy support S3 uploads?
Yes, please check out the docs for more information.
Can I use Uppy with Rails/Node.js/Go/PHP?
Yes, whatever you want on the backend will work with @uppy/xhr-upload
plugin,
since it only does a POST
or PUT
request. Hereâs a
PHP backend example.
If you want resumability with the Tus plugin, use one of the tus server implementations ðð¼
And youâll need @uppy/companion
if youâd
like your users to be able to pick files from Instagram, Google Drive, Dropbox
or via direct URLs (with more services coming).
Contributions are welcome
- Contributorâs guide in
.github/CONTRIBUTING.md
- Changelog to track our release progress (we aim to roll out a release every
month):
CHANGELOG.md
Used by
Uppy is used by: Photobox, Issuu, Law Insider, Cool Tabs, Soundoff, Scrumi, Crive and others.
Use Uppy in your project? Let us know!
Contributors
License
The MIT License.
Top Related Projects
A pure JavaScript client for the tus resumable upload protocol
File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.
Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.
Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
Simple HTML5 drag-drop zone with React.js.
Promise based HTTP client for the browser and node.js
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot