Robodog

Transloadit is a service that helps you handle file uploads, resize, crop and watermark your images, make GIFs, transcode your videos, extract thumbnails, generate audio waveforms, and so much more. In short, Transloadit is the Swiss Army Knife for your files.

Robodog is an Uppy-based library that helps you talk to the Transloadit API. It includes a modal UI file picker with support for imports from third-party services, integration with HTML forms, and more. Because it’s based on Uppy, you can add any existing Uppy plugin to add more functionality.

Install

Robodog can be downloaded from npm:

npm install --save @uppy/robodog

Then, with a bundler such as webpack or Browserify, do:

const transloadit = require('@uppy/robodog')

If you are not using a bundler, you can also import the Robodog using an HTML script tag.

<link rel="stylesheet" href="https://transloadit.edgly.net/releases/robodog/v1.0.0/dist/style.min.css">
<script src="https://transloadit.edgly.net/releases/robodog/v1.0.0/dist/transloadit.min.js"></script>

Methods

Robodog has several methods for different use cases.

If you want to have a modal UI that users can use to select files from their local device or from third party sources like Instagram, use the File Picker API. This can be used for one-off uploads outside an HTML form, like profile avatars or images to embed in a blog post.

If you already have an HTML form, you can use the Form API to add Transloadit’s encoding capabilities to it. Files will be uploaded to Transloadit, and the form will submit JSON information about the files and encoding results. You can also optionally show upload progress using Uppy’s Status Bar UI, or even use the advanced Dashboard UI so users can import files from third party sources as well.

Finally, you can use the Programmatic Upload API with your custom UI implementation.

And if any of these methods are not flexible enough, you can always replace them with a custom Uppy setup using the Transloadit Plugin instead!

File Picker

Show a modal UI that allows users to pick files from their device and from the web. It uploads files to Transloadit for processing.

const resultPromise = transloadit.pick({
  target: 'body',
  params: {
    auth: { key: '' },
    template_id: ''
  }
})
resultPromise.then((bundle) => {
  bundle.transloadit // Array of Assembly statuses
  bundle.results // Array of all Assembly results
})

Robodog File Picker Demo GIF

View Documentation

Form

Add resumable uploads and Transloadit’s processing to your existing HTML upload forms. Selected files will be uploaded to Transloadit, and the Assembly information will be submitted to your form endpoint.

<form id="myForm" method="POST" action="/upload">
  <input type="file" multiple>
  <!-- Will be inserted by `transloadit.form()`: -->
  <!-- <input type="hidden" name="transloadit" value="{...json...}"> -->
  <button type="submit">Upload</button>
</form>
<script>
transloadit.form('form#myForm', {
  params: {
    auth: { key: '' },
    template_id: ''
  }
})
</script>

View Documentation

Programmatic Uploads

Upload files straight to Transloadit from your own custom UI. Give us an array of files, and we’ll give you an array of results!

const resultPromise = transloadit.upload(files, {
  params: {
    auth: { key: '' },
    template_id: ''
  }
})
resultPromise.then((bundle) => {
  bundle.transloadit // Array of Assembly statuses
  bundle.results // Array of all Assembly results
})

View Documentation