All Projects → kimmelsg → Cj Upload

kimmelsg / Cj Upload

Licence: mit
Higher order React components for file uploading (with progress) react file upload

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Cj Upload

Uploader
A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
Stars: ✭ 1,042 (+76.91%)
Mutual labels:  upload, file, progress
Chibisafe
Blazing fast file uploader and awesome bunker written in node! 🚀
Stars: ✭ 657 (+11.54%)
Mutual labels:  upload, file, 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 (-68.93%)
Mutual labels:  upload, file, file-upload
Fileup
FileUp - JQuery File Upload
Stars: ✭ 10 (-98.3%)
Mutual labels:  upload, file, file-upload
Pomf
Simple file uploading and sharing
Stars: ✭ 535 (-9.17%)
Mutual labels:  upload, file, 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 (-84.38%)
Mutual labels:  upload, file, file-upload
angular-progress-http
[DEPRECATED] Use @angular/common/http instead
Stars: ✭ 43 (-92.7%)
Mutual labels:  xhr, progress, upload
rustypaste
A minimal file upload/pastebin service.
Stars: ✭ 102 (-82.68%)
Mutual labels:  upload, file-upload
SimpleBatchUpload
Allows for basic, no-frills uploading of multiple files
Stars: ✭ 15 (-97.45%)
Mutual labels:  upload, file-upload
react-awesome-loaders
🚀 High quality, super responsive and completely customisable Loading Animations to insert into your website with single line of code.
Stars: ✭ 146 (-75.21%)
Mutual labels:  progress, react-components
vue-simple-upload-component
A simple upload component for Vue.js 2.x
Stars: ✭ 14 (-97.62%)
Mutual labels:  upload, file-upload
lolisafe
Blazing fast file uploader and awesome bunker written in node! 🚀
Stars: ✭ 181 (-69.27%)
Mutual labels:  upload, file-upload
Meteor-Files-Demos
Demos for ostrio:files package
Stars: ✭ 51 (-91.34%)
Mutual labels:  upload, file-upload
kipp
A flexible file storage server
Stars: ✭ 33 (-94.4%)
Mutual labels:  upload, file-upload
safe-svg
Enable SVG uploads and sanitize them to stop XML/SVG vulnerabilities in your WordPress website.
Stars: ✭ 129 (-78.1%)
Mutual labels:  upload, file
yii2-dropzone
This extension provides the Dropzone integration for the Yii2 framework.
Stars: ✭ 11 (-98.13%)
Mutual labels:  upload, file-upload
file-upload-with-preview
🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well with or without a framework.
Stars: ✭ 406 (-31.07%)
Mutual labels:  upload, file
ShareX-CDN
Basic image, text & file uploader CDN for ShareX
Stars: ✭ 22 (-96.26%)
Mutual labels:  upload, file
image-uploader
Simple Drag & Drop image uploader plugin to static forms, without using AJAX
Stars: ✭ 70 (-88.12%)
Mutual labels:  upload, file-upload
File Upload With Preview
🖼 A simple file-upload utility that shows a preview of the uploaded image. Written in pure JavaScript. No dependencies. Works well with Bootstrap 4 or without a framework.
Stars: ✭ 352 (-40.24%)
Mutual labels:  upload, file

Deprecated

Please look at react-use-upload for the same functionality, updated using React hooks.

CircleCI Coverage Status

@navjobs/upload

v4

I'm working on a v4 soon that simplfies the api and removes the children-as-a-function paradigm to something more extendable. Also revamping the test suit. It'll be a complete rewrite.

What

A set of React components for handling file uploads. If you simply want to turn any component into a file upload dialog, wrap it in our <UploadField/> component that exposes the files after selection. Need to process a file upload and receive the upload progress? Wrap <UploadField/> with <Uploader/>. You can see examples inside our storybook.

Why this?

  • Any component can be an upload dialog. Wrap it in <UploadField/>. This means you have ultimate styling control.
  • Simple component API for upload progress. Pass headers, extra fields, anything.
  • Zero dependencies (other than React!)

Install

yarn add @navjobs/upload

In this library

  • UploadField gives access to files after drag and drop / clicking on the area wrapped
  • Uploader triggers an xhr upload to a url with file progress
  • SignedUploader same as above, but helps generate a signed url from your api.
  • Imperative api that lets you trigger a file upload with progress outside of react.

UploadField

import { UploadField } from '@navjobs/upload'

  <UploadField
    onFiles={files => //files object here}
    containerProps={{
      className: 'resume_import'
    }}
    uploadProps={{
      accept: '.pdf,.doc,.docx,.txt,.rtf',
    }}
  >
    <div>
      Click here to upload! This can be an image,
      or any component you can dream of.
    </div>
  </UploadField>

Uploader

Use <UploadField /> inside of this component; pass the files to it and handle the upload!

import { Uploader } from '@navjobs/upload'

<Uploader
  request={{
    fileName: 'file',
    url: 'https://upload.com',
    method: 'POST',
    fields: {
      //extra fields to pass with the request
      full_name: 'Testing extra fields',
    },
    headers: {
      //custom headers to send along
      Authorization: 'Bearer: Test',
    },
    // use credentials for cross-site requests
    withCredentials: false,
  }}
  onComplete={({ response, status }) => /*do something*/}
  //upload on file selection, otherwise use `startUpload`
  uploadOnSelection={true}
>
  {({ onFiles, progress, complete }) => (
    <div>
      <UploadField onFiles={onFiles}>
        <div>
          Click here to select a file!
        </div>
      </UploadField>
      {progress ? `Progress: ${progress}` : null}
      {complete ? 'Complete!' : null}
    </div>
  )}
</Uploader>

Signed Uploader

This is a useful component for generating signed urls on your backend for a service like AWS or Google Cloud. The workflow generally involes hitting your own api, then uploading to the url that your api returns. After the fact, you hit your api again to say that the upload is finished.

import { SignedUploader } from '@navjobs/upload'


<SignedUploader
  //grab this url from your api
  beforeRequest={() => new Promise(resolve => resolve({ url: 'http://storage.googlecloud.com' }))}
  request={({ before, files }) => ({
      url: before.url,
      method: 'PUT',
      headers: {
        'Content-Type': files[0].type
      }
    })}
  afterRequest={({ before, status }) => new Promise(resolve => {
    resolve('finished the upload!');
  })}
>

Imperative API

If you need to upload files and recieve progress, but can't wrap an Uploader around where you receive the files, feel free to use this:

import { UploadRequest } from '@navjobs/upload'

async uploadFiles() {
  let { response, error, aborted } = await UploadRequest(
    {
      request: {
        url: 'blah' //same as above request object
      },
      files, //files array
      progress: value => console.log('progress!', value)
    }  
  )
  //do something with response
}

FAQ

Q: Part of the component I'm wrapping isn't cursor pointer?

A: You may need to set

::-webkit-file-upload-button { cursor:pointer; }

In your css. For some reason file uploads aren't always pointer.

License

This project is licensed under the terms of the MIT license.

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].