uppy-tests.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import Uppy = require('./');
  2. (() => {
  3. const uppy = Uppy.Core({ autoProceed: false });
  4. uppy.use(Uppy.Dashboard, { trigger: '#up_load_file_01' });
  5. uppy.use(Uppy.DragDrop, { target: '#ttt' });
  6. uppy.use(Uppy.XHRUpload, {
  7. bundle: true,
  8. endpoint: 'xxx',
  9. fieldName: 'up_load_file'
  10. });
  11. uppy.run();
  12. uppy.on('upload-success', (fileCount, body, uploadurl) => {
  13. console.log(fileCount, body, uploadurl, ` files uploaded`);
  14. });
  15. })();
  16. (() => {
  17. const uppy = Uppy.Core({ autoProceed: false })
  18. .use(Uppy.Dashboard, { trigger: '#select-files' })
  19. .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, host: 'https://server.uppy.io' })
  20. .use(Uppy.Instagram, { target: Uppy.Dashboard, host: 'https://server.uppy.io' })
  21. .use(Uppy.Webcam, { target: Uppy.Dashboard })
  22. .use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' })
  23. .run()
  24. .on('complete', (result) => {
  25. console.log('Upload result:', result)
  26. });
  27. })();
  28. (() => {
  29. var uppy = Uppy.Core()
  30. uppy.use(Uppy.DragDrop, { target: '.UppyDragDrop' })
  31. uppy.use(Uppy.Tus, { endpoint: '//master.tus.io/files/' })
  32. uppy.run()
  33. })();