|
6 years ago | |
---|---|---|
.. | ||
src | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
bundle.js | 6 years ago | |
package.json | 6 years ago |
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.
Uppy is being developed by the folks at Transloadit, a versatile file encoding service.
transloadit.form
attaches Transloadit to an existing HTML form.
It could act like the jQuery SDK using the @uppy/file-input
plugin,
or it could also add the @uppy/dashboard
.
Uploads files on form submission, adds results to a hidden input,
then really submits the form.
const transloadit = require('@uppy/robodog')
transloadit.form('#form', {
params: {
auth: { key: '' },
template_id: ''
}
})
Adding Dashboard could be optional, eg
transloadit.form('#form', {
...
dashboard: true // or css selector, true means input[type=file]
})
The file input would be replaced by a button that opens the dashboard modal. Needs:
transloadit.modal
opens the Dashboard and allows the user to select files.
When the user is done, presses 'upload', files are uploaded and the modal closes.
Promise resolves with results.
Needs:
{multi: false}
option in core, so that no new files can be added once upload()
was called{autoClose: true}
option in dashboard, that closes it once upload is completetransloadit.modal({
params: {
auth: { key: '' },
template_id: ''
}
}).then(({ successful, failed }) => {
// successful, failed are uppy.upload() result
// perhaps it could be assembly status or assembly results instead
})
$ npm install @uppy/transloadit --save
We recommend installing from npm and then using a module bundler such as Webpack, Browserify or Rollup.js.
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case Uppy
will attach itself to the global window.Uppy
object. See the main Uppy documentation for instructions.
Documentation for this plugin can be found on the Uppy website.