mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 19:23:55 +00:00
21 lines
781 B
Text
21 lines
781 B
Text
import Uppy from 'uppy/lib/core'
|
||
import Dashboard from 'uppy/lib/plugins/Dashboard'
|
||
import Tus10 from 'uppy/lib/plugins/Tus10'
|
||
import Informer from 'uppy/lib/plugins/Informer'
|
||
import MetaData from 'uppy/lib/plugins/MetaData'
|
||
|
||
const uppy = Uppy({autoProceed: false})
|
||
.use(Dashboard, {trigger: '#select-files'})
|
||
.use(Informer, {target: Dashboard})
|
||
.use(Tus10, {endpoint: '://master.tus.io/files/'})
|
||
.use(MetaData, {
|
||
fields: [
|
||
{ id: 'resizeTo', name: 'Resize to', value: 1200, placeholder: 'specify future image size' },
|
||
{ id: 'description', name: 'Description', value: 'none', placeholder: 'describe what the file is for' }
|
||
]
|
||
})
|
||
.run()
|
||
|
||
uppy.on('core:success', (fileCount) => {
|
||
console.log(`Upload complete. We uploaded ${fileCount} files!`)
|
||
})
|