uploadtest.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="css/spinkit-loader.css" type="text/css" />
  4. </head>
  5. <body>
  6. <form id="data-upload" enctype="multipart/form-data">
  7. <input name="dir" id="dir-input" type="file" webkitdirectory directory multiple/><br/>
  8. <input type="button" onclick="uploadAwsFiles()" value="Upload"/>
  9. </form>
  10. <div id="dir-info"></div>
  11. <div id="file-info"></div>
  12. <p>
  13. <span id="progress-number">0</span> files remaining</p>
  14. <div id="upload-console"></div>
  15. <div id="error-messages"></div>
  16. <script type="text/javascript" src="/js/ajax.js"></script>
  17. <script type="text/javascript" src="/js/resumefilemanager.js"></script>
  18. <script type="text/javascript">
  19. function readableFileSize(rawsize) {
  20. var readable = "";
  21. if (rawsize > 1024 * 1024 * 1024) {
  22. readable = (Math.round(rawsize * 100 / (1024 * 1024 * 1024)) / 100).toString() + ' GB';
  23. } else if (rawsize > 1024 * 1024) {
  24. readable = (Math.round(rawsize * 100 / (1024 * 1024)) / 100).toString() + ' MB';
  25. } else if (rawsize > 1024) {
  26. readable = (Math.round(rawsize * 100 / 1024) / 100).toString() + ' KB';
  27. } else {
  28. readable = rawsize + ' bytes';
  29. }
  30. return readable;
  31. }
  32. function uploadAwsFiles() {
  33. fileManager.resumeUpload(2);
  34. }
  35. document.addEventListener("DOMContentLoaded", function(event) {
  36. document.getElementById("dir-input").addEventListener('change', function(event) {
  37. fileManager.process();
  38. });
  39. });
  40. </script>
  41. </body>
  42. </html>