mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-27 12:13:53 +00:00
19 lines
No EOL
750 B
Text
19 lines
No EOL
750 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: 'resizeTo', name: 'Resize to', value: 1200, placeholder: 'specify future image size' },
|
||
{ id: 'description', name: 'Description', value: 'none', placeholder: 'describe what the file is for' }
|
||
]
|
||
})
|
||
uppy.run()
|
||
|
||
uppy.on('core:success', (files) => {
|
||
console.log(`Upload complete! We’ve uploaded these files: ${files}`)
|
||
}) |