UNPKG

uppy

Version:

Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:

25 lines (23 loc) 846 B
<!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://transloadit.edgly.net/releases/uppy/v0.23.2/dist/uppy.min.css" rel="stylesheet"> </head> <body> <button id="uppyModalOpener">Open Modal</button> <script src="https://transloadit.edgly.net/releases/uppy/v0.23.2/dist/uppy.min.js"></script> <script> const uppy = Uppy.Core({debug: true, autoProceed: false}) .use(Uppy.Dashboard, { trigger: '#uppyModalOpener' }) .use(Uppy.Webcam, {target: Uppy.Dashboard}) .use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' }) .run() uppy.on('success', (fileCount) => { console.log(`${fileCount} files uploaded`) }) </script> </body> </html>