How to use @uppy/transloadit - 3 common examples

To help you get started, we’ve selected a few @uppy/transloadit 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 / packages / @uppy / robodog / src / addProviders.js View on Github external
function addRemoteProvider (uppy, name, opts) {
  const Provider = remoteProviders[name]
  const providerOptions = {
    // Default to the :tl: Companion servers.
    companionUrl: Transloadit.COMPANION,
    companionAllowedHosts: Transloadit.COMPANION_PATTERN
  }

  remoteProviderOptionNames.forEach((name) => {
    if (has(opts, name)) providerOptions[name] = opts[name]
  })
  // Apply overrides for a specific provider plugin.
  if (typeof opts[name] === 'object') {
    Object.assign(providerOptions, opts[name])
  }

  uppy.use(Provider, providerOptions)
}
github transloadit / uppy / packages / @uppy / robodog / src / addProviders.js View on Github external
function addRemoteProvider (uppy, name, opts) {
  const Provider = remoteProviders[name]
  const providerOptions = {
    // Default to the :tl: Companion servers.
    companionUrl: Transloadit.COMPANION,
    companionAllowedHosts: Transloadit.COMPANION_PATTERN
  }

  remoteProviderOptionNames.forEach((name) => {
    if (has(opts, name)) providerOptions[name] = opts[name]
  })
  // Apply overrides for a specific provider plugin.
  if (typeof opts[name] === 'object') {
    Object.assign(providerOptions, opts[name])
  }

  uppy.use(Provider, providerOptions)
}
github transloadit / uppy / website / src / examples / transloadit / app.es6 View on Github external
uppy
    .use(Transloadit, {
      getAssemblyOptions,
      waitForEncoding: true
    })
    .use(Dashboard, {
      inline: true,
      maxHeight: 400,
      target: '#uppy-dashboard-container',
      note: 'Images only, 1–2 files, up to 1 MB'
    })
    .use(Instagram, {
      target: Dashboard,
      companionUrl: 'https://api2.transloadit.com/companion',
      companionAllowedHosts: Transloadit.COMPANION_PATTERN
    })
    .use(Webcam, { target: Dashboard, modes: ['picture'] })

  uppy
    .on('transloadit:result', (stepName, result) => {
      const file = uppy.getFile(result.localId)
      var resultContainer = document.createElement('div')
      resultContainer.innerHTML = `
        <div>
          <h3>Name: ${file.name}</h3>
          <img src="${result.ssl_url}"> <br>
          <a href="${result.ssl_url}">View</a>
        </div>
      `
      document
        .getElementById('uppy-transloadit-result')

@uppy/transloadit

The Transloadit plugin can be used to upload files to Transloadit for all kinds of processing, such as transcoding video, resizing images, zipping/unzipping, and more

MIT
Latest version published 19 days ago

Package Health Score

92 / 100
Full package analysis