kuvia2/templates/file_upload.tmpl

26 lines
949 B
Cheetah
Raw Normal View History

2022-01-14 23:09:03 +00:00
{{template "top" .}}
<link href="https://releases.transloadit.com/uppy/v2.3.1/uppy.min.css" rel="stylesheet">
<div class="container" style="margin-top: 100px;">
<div class="col-12">
<h1>Dashboard</h1>
<div id="drag-drop-area"></div>
</div>
</div>
<script src="https://releases.transloadit.com/uppy/v2.3.1/uppy.min.js"></script>
<script>
const { Instagram } = Uppy
const { Dashboard } = Uppy
var uppy = new Uppy.Core()
.use(Uppy.Dashboard, {
inline: true,
target: '#drag-drop-area'
})
.use(Uppy.XHRUpload, {endpoint: '/file/upload?id={{.id}}'})
//.use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
uppy.on('complete', (result) => {
console.log('Upload complete! Weve uploaded these files:', result.successful)
})
</script>
{{template "bottom" .}}