How to use uppy - 3 common examples

To help you get started, we’ve selected a few uppy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github transloadit / uppy / test / endtoend / typescript / main.ts View on Github external
Core,
  Dashboard,
  Instagram,
  Dropbox,
  GoogleDrive,
  Url,
  Webcam,
  Tus,
  Form
} from 'uppy'

// @ts-ignore
const isOnTravis = !!(process.env.TRAVIS && process.env.CI)
const TUS_ENDPOINT = `http://${isOnTravis ? 'companion.test' : 'localhost'}:1080/files/`

const uppy = Core({
  debug: true,
  meta: {
    username: 'John',
    license: 'Creative Commons'
  }
})
  .use(Dashboard, {
    target: document.body,
    trigger: '#pick-files',
    metaFields: [
      { id: 'license', name: 'License', placeholder: 'specify license' },
      { id: 'caption', name: 'Caption', placeholder: 'add caption' }
    ],
    showProgressDetails: true,
    proudlyDisplayPoweredByUppy: true,
    note: '2 files, images and video only'
github rai-project / mlmodelscope / src / components / UploadArea / index.js View on Github external
componentDidMount() {
      this.uppy = new Core({
        debug: true,
        autoProceed: false,
        restrictions: {
          maxFileSize: 6000000,
          maxNumberOfFiles: 5,
          minNumberOfFiles: 1,
          allowedFileTypes: ["image/*"]
        },
        onBeforeFileAdded: (currentFile, files) => {
          if (currentFile.type && currentFile.type.split("/")[0] === "image") {
            return Promise.resolve();
          }
          return Promise.reject("Invalid file format. Please upload an image");
        },
        onBeforeUpload: files => {
          if (Object.keys(files).length > 5) {
github bodhiproject / bodhi-ui / src / components / uielements / uppy.js View on Github external
export default function uppyInit(options, onSuccess) {
  const uppy = Uppy({
    debug: true,
    autoProceed: options.autoProceed,
    restrictions: options.restrictions || '',
  });
  uppy.use(Tus10, { endpoint: options.endpoint, resume: true });
  uppy.use(Dashboard, {
    trigger: options.trigger,
    inline: options.DashboardInline,
    target: options.target,
    note: options.restrictions || 'Images and video only, 300kb or less',
  });
  if (options.GoogleDrive) {
    uppy.use(GoogleDrive, { target: Dashboard, host: SERVER });
  }
  if (options.Dropbox) {
    uppy.use(Dropbox, { target: Dashboard, host: SERVER });

uppy

Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:

MIT
Latest version published 2 days ago

Package Health Score

92 / 100
Full package analysis

Popular uppy functions