All Projects → rpldy → React Uploady

rpldy / React Uploady

Licence: mit
Modern file uploading - components & hooks for React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Uploady

Pomf
Simple file uploading and sharing
Stars: ✭ 535 (+43.82%)
Mutual labels:  files, upload, file-upload
vue-simple-upload-component
A simple upload component for Vue.js 2.x
Stars: ✭ 14 (-96.24%)
Mutual labels:  drag-and-drop, upload, file-upload
Angular File Uploader
Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.
Stars: ✭ 92 (-75.27%)
Mutual labels:  upload, drag-and-drop, file-upload
lolisafe
Blazing fast file uploader and awesome bunker written in node! 🚀
Stars: ✭ 181 (-51.34%)
Mutual labels:  files, upload, file-upload
Telegram Upload
Upload and download files from Telegram up to 2GiB using your account
Stars: ✭ 223 (-40.05%)
Mutual labels:  files, upload, file-upload
yii2-dropzone
This extension provides the Dropzone integration for the Yii2 framework.
Stars: ✭ 11 (-97.04%)
Mutual labels:  drag-and-drop, upload, file-upload
kipp
A flexible file storage server
Stars: ✭ 33 (-91.13%)
Mutual labels:  files, upload, file-upload
Chibisafe
Blazing fast file uploader and awesome bunker written in node! 🚀
Stars: ✭ 657 (+76.61%)
Mutual labels:  files, upload, file-upload
Uploadcare Widget
Uploadcare Widget, an ultimate tool for HTML5 file upload supporting multiple file upload, drag&drop, validation by file size/file extension/MIME file type, progress bar for file uploads, image preview.
Stars: ✭ 183 (-50.81%)
Mutual labels:  files, upload, file-upload
Express Fileupload
Simple express file upload middleware that wraps around busboy
Stars: ✭ 1,069 (+187.37%)
Mutual labels:  files, upload, file-upload
react-magic-dropzone
✨Magically drag and drop files/links for uploading
Stars: ✭ 11 (-97.04%)
Mutual labels:  files, drag-and-drop, upload
react-butterfiles
🦋 Component for building file fields - from basic file inputs to drag and drop image galleries.
Stars: ✭ 44 (-88.17%)
Mutual labels:  files, drag-and-drop, file-upload
image-uploader
Simple Drag & Drop image uploader plugin to static forms, without using AJAX
Stars: ✭ 70 (-81.18%)
Mutual labels:  drag-and-drop, upload, file-upload
eventrix
Open-source, Predictable, Scaling JavaScript library for state managing and centralizing application global state. State manage system for react apps.
Stars: ✭ 35 (-90.59%)
Mutual labels:  hooks, ssr
vue3-dropzone
HTML5 drag-drop zone with vue3
Stars: ✭ 34 (-90.86%)
Mutual labels:  drag-and-drop, file-upload
Meteor-Files-Demos
Demos for ostrio:files package
Stars: ✭ 51 (-86.29%)
Mutual labels:  upload, file-upload
rustypaste
A minimal file upload/pastebin service.
Stars: ✭ 102 (-72.58%)
Mutual labels:  upload, file-upload
SimpleBatchUpload
Allows for basic, no-frills uploading of multiple files
Stars: ✭ 15 (-95.97%)
Mutual labels:  upload, file-upload
upload
How to Upload a File to a Server in PHP
Stars: ✭ 83 (-77.69%)
Mutual labels:  files, file-upload
postonents
React meets Emails | ⚛️ x 📧= 🔥
Stars: ✭ 90 (-75.81%)
Mutual labels:  components, ssr

react-uploady Logo

Modern file-upload components & hooks for React.

circleci status codecov status rpldy storybook lerna MIT License

Contents

Intro

React-Uploady is a lightweight library - enabling you to build (client-side) file-upload features with just a few lines of code. RU provides the foundations needed to upload files from the browser - The rest is up to you.

React-Uploady Demo

The philosophy behind this library is that it should be as simple as possible to use, yet customizable at every point. You can start simple, or you can can configure just about every aspect of the upload flow. For this purpose, RU provides components, hooks, and plenty of features. You get to choose which ones you need and only install the dependencies required (See Packages details below)

RU has a small footprint (by design) with very few (and small) dependencies.

Bundle Minified size GZipped size
core 35.5KB 11.4KB
core + ui 47.6KB 14.6KB
core + ui + chunked support 58.0KB 17.0KB
everything 84.5KB 24.2KB

Documentation

Getting Started

We recommend checking out the Uploady README first to understand how to configure your uploads and how to access upload data (using the provided hooks or events).

It's also worth reading the Important Concepts section below for some key concepts.

In case you need UI components (like an upload button), check out the UI packages.

Additional Resources

Our Storybook has many examples, both simple and advanced.

Check out our Guides section for additional examples & information.

Changelog

For a list of versions and changes, see the CHANGELOG

Discussions

Please check the discussions area here in Github. If you have a question about use-cases or flows you'd like to achieve with Uploady, discussions is the place to look for existing answers or add your own.

If you're using Uploady in Production, please drop a comment here. It's always great to hear how people and companies use it.

Installation

React-uploady is a mono-repo, and as such provides multiple packages with different functionality.

For React applications, at the very least, you will need the Uploady provider:

#Yarn: 
   $ yarn add @rpldy/uploady

#NPM:
   $ npm i @rpldy/uploady

If you wish to use the uploading mechanism (no UI), at the very least, you will need the Uploader:

#Yarn:
  $ yarn add @rpldy/uploader

#NPM:
  $ npm i @rpldy/uploader

After that, you can add additional packages as needed. See below for more details.

Packages

Main Packages

UI Packages

Providers

Senders

Extra

Shared Packages

React Native

Examples

For specific usage, see documentation in the relevant package README file.

For upload options see the @rpldy/uploady docs.

Simple Upload Button

This examples shows how you add Uploady and UploadButton to your app. This is all it takes to get file uploading to work in your React application.

import React from "react";
import Uploady from "@rpldy/uploady";
import UploadButton from "@rpldy/upload-button";

const App = () => (<Uploady
    destination={{ url: "https://my-server/upload" }}>
    <UploadButton/>
</Uploady>);

Custom Upload Button

In case you want to use your own component as the upload trigger, use the asUploadButton HOC:

import React from "react";
import Uploady from "@rpldy/uploady";
import { asUploadButton } from "@rpldy/upload-button";

const DivUploadButton = asUploadButton((props) => {
    return <div {...props} style={{ cursor: "pointer" }}>
        DIV Upload Button
    </div>
});

const App = () => (<Uploady
    destination={{ url: "https://my-server/upload" }}>
    <DivUploadButton/>
</Uploady>);

Progress Hook

import React from "react";
import Uploady, { useItemProgressListener } from "@rpldy/uploady";
import UploadButton from "@rpldy/upload-button";

//must be rendered inside <Uploady>
const LogProgress = () => {
    useItemProgressListener((item) => {
        console.log(`>>>>> (hook) File ${item.file.name} completed: ${item.completed}`);
    });

    return null;
}

const App = () => (<Uploady
    destination={{ url: "https://my-server/upload" }}>
    <LogProgress/>   
    <UploadButton/>
</Uploady>);

Add support for resumable(tus) uploads

 import React from "react";
 import TusUploady from "@rpldy/tus-uploady";
 import UploadButton from "@rpldy/upload-button";
 
 const App = () => (<TusUploady
     destination={{ url: "https://my-tus-server/upload" }}
     chunkSize={2142880}
     sendDataOnCreate>
     <UploadButton/>
 </TusUploady>);

Add support for chunked uploads

Can be used with servers that support chunked uploads

import React from "react";
import ChunkedUploady from "@rpldy/chunked-uploady";
import UploadButton from "@rpldy/upload-button";

const App = () => (<ChunkedUploady
    destination={{ url: "https://my-server/upload" }}
    chunkSize={5242880}>
       
    <UploadButton/>
</ChunkedUploady>);

See more (advanced) examples in our guides and storybook.

Important Concepts

Upload Options

These are the options that are passed to the uploader to configure aspects of the upload process. For example, whether files can be grouped in a single request (by default, no).

Upload Options are typically passed to the Uploady instance. But these can be overriden. For example, by props passed to the upload button. Or even during upload processing.

Destination

Passed as a part of the upload options. It's an object that is used to configure the end-point where the files will be uploaded to. It's type is defined here.

See more information in the Uploady README.

At the very least, a destination should contain a URL property with the server endpoint.

Enhancer

(uploader: UploaderType, trigger: Trigger<mixed>) => UploaderType

Enhancers are functions that can enhance an uploader instance. They are also passed as part of the options given to the Uploady instance.

As they are applied when the uploader instance is created, they can change the way uploader does things or pass different defaults.

See this guide for practical information and sample code.

Batch

When a file or files are handed over to the uploader, they are grouped into a batch. This batch will have its own lifetime events. With a batch ID, it is possible to cancel all files that are part of it. It can also be used to retry all files in the batch (see @rpldy/retry).

BatchItem

Each file (or URL) added to the uploader are wrapped by a BatchItem object. They will have a unique ID within the life-time of the uploader instance. A BatchItem has its own lifetime events.

Resumable Uploads

RU supports resumable uploads through the tus protocol. Instead of using from @rpldy/uploady, use from @rpldy/tus-uploady and you will have resumable upload support on the client side. Your server will also have to support the same protocol for this to work of course.

See the @rpldy/tus-uploady documentation for more details.

UMD Bundles

React-uploady is also available on CDNs such as unpkg.com and jsdelivr.com

See this guide for more information on how to use.

jsDelivr

Bundle URL
core https://cdn.jsdelivr.net/npm/@rpldy/uploader/umd/rpldy-core.umd.min.js
core + ui https://cdn.jsdelivr.net/npm/@rpldy/uploady/umd/rpldy-ui-core.umd.min.js
core + ui + chunked support https://cdn.jsdelivr.net/npm/@rpldy/chunked-uploady/umd/rpldy-ui-core-chunked.umd.min.js
everything https://cdn.jsdelivr.net/npm/@rpldy/uploady/umd/rpldy-all.umd.min.js

You will most likely need the polyfill (core js) bundle as well (load it first):

unpkg

Bundle URL
core https://unpkg.com/@rpldy/uploader/umd/rpldy-core.umd.min.js
core + ui https://unpkg.com/@rpldy/uploady/umd/rpldy-ui-core.umd.min.js
core + ui + chunked support https://unpkg.com/@rpldy/chunked-uploady/umd/rpldy-ui-core-chunked.umd.min.js
everything https://unpkg.com/@rpldy/uploady/umd/rpldy-all.umd.min.js

You will most likely need the polyfill (core js) bundle as well (load it first):

Note that unpkg does a redirect to the latest version in case the URL doesn't already contain it. So don't copy any of the URLs above into your code. Instead, load them in the browser first and then copy the final URL from there (after the redirect).

Acknowledgements

logo's wing thanks to Illustration Vectors by Vecteezy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].