forked from gigascience/gigadb-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uppy-example.html
47 lines (45 loc) · 1.42 KB
/
uppy-example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example of uppy</title>
<link href="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.css" rel="stylesheet">
</head>
<body>
<form id="dataset-metadata-form">
<input id="dataset" type="hidden" value="100006">
</form>
<div id="drag-drop-area"></div>
<script src="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.js"></script>
<script>
var uppy = Uppy.Core()
.use(Uppy.Dashboard, {
inline: true,
target: '#drag-drop-area',
hideAfterFinish: true,
showProgressDetails: true,
hideUploadButton: false,
hideRetryButton: false,
hidePauseResumeButton: false,
hideCancelButton: false,
metaFields: [
{ id: 'name', name: 'Name', placeholder: 'file name' },
{ id: 'description', name: 'Description', placeholder: 'describe what the file is about' }
],
locale: {}
})
.use(Uppy.Form, {
target: "#dataset-metadata-form",
getMetaFromForm: true,
addResultToForm: false,
triggerUploadOnSubmit: false,
submitOnSuccess: false
})
// .use(Uppy.Tus, {endpoint: 'https://master.tus.io/files/'});
.use(Uppy.Tus, {endpoint: 'http://gigadb.gigasciencejournal.com:9080/files/'});
uppy.on('complete', (result) => {
console.log('Upload complete! We’ve uploaded these files:', result.successful);
})
</script>
</body>
</html>