mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-28 12:37:00 +00:00
19 lines
No EOL
746 B
Text
19 lines
No EOL
746 B
Text
import Uppy from 'uppy/lib/core'
|
||
import Dashboard from 'uppy/lib/plugins/Dashboard'
|
||
import Tus10 from 'uppy/lib/plugins/Tus10'
|
||
import MetaData from 'uppy/lib/plugins/MetaData'
|
||
|
||
const uppy = Uppy({autoProceed: false})
|
||
.use(Dashboard, {trigger: '#select-files', target: '#upload-form', replaceTargetContent: true})
|
||
.use(Tus10, {endpoint: '://master.tus.io/files/'})
|
||
.use(MetaData, {
|
||
fields: [
|
||
{ id: 'license', name: 'License', value: 'Creative Commons', placeholder: 'specify license' },
|
||
{ id: 'caption', name: 'Caption', value: 'none', placeholder: 'describe what the image is about' }
|
||
]
|
||
})
|
||
uppy.run()
|
||
|
||
uppy.on('core:success', (files) => {
|
||
console.log(`Upload complete! We’ve uploaded these files: ${files}`)
|
||
}) |