ftp.html 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html><html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
  2. <head><title>MiXplorer</title><link rel="shortcut icon" href="/favicon.ico">
  3. <style>body{background-color:#F9F9F9;color:#222222;margin:10px;padding:0}
  4. h1,h2,h3 {font-family:Helvetica,Verdana,sans-serif;padding:0;margin:0}
  5. h3.directory {font-size:18px;float:left;width:auto}
  6. h2.deviceName {font-size:20px;float:right;text-align:right;width:auto}
  7. a{text-decoration:none;color:#112387}
  8. span.dirname {font-family:Helvetica,Verdana,sans-serif;font-size:14px;font-weight:bold}
  9. .share {font-size:16px;color:#000080}
  10. span.filesize {font-size:12px;color:#808080}
  11. #content {font-family:Geneva,Arial,Helvetica,sans-serif;font-size: 12px;font-weight:normal;color:#222222;width:400px;padding:5px;margin:0}
  12. .sbtn {height:22px;width:82px;font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px;padding:0;margin:0}
  13. #mform {font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px;font-weight:normal;color:#222222}
  14. ul{display:block;clear:left;list-style-type:circle}
  15. li{color:#222222;margin:10px}</style>
  16. <!--<link rel="stylesheet" type="text/css" href="/style.css"/>-->
  17. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  18. <script language="javascript" type="text/javascript">
  19. <!--
  20. var unit = ['KiB','MiB','GiB','TiB'];
  21. function readableSize(bytes) {
  22. if (Math.abs(bytes) < 1024)
  23. return bytes + 'B';
  24. var i = -1;
  25. do {
  26. bytes /= 1024;
  27. i++;
  28. } while (i<unit.length-1 && (Math.round(Math.abs(bytes)*10)/10) >= 1024);
  29. return bytes.toFixed(1) + '' + unit[i];
  30. }
  31. function $(id){return document.getElementById(id)}
  32. function startUpload() {
  33. var element = $('fil');
  34. var f = element.files[0];
  35. if (f != null) {
  36. var p = $('progress');
  37. var xhr = new XMLHttpRequest();
  38. xhr.upload.addEventListener("progress", function (e) {
  39. if (e.lengthComputable)
  40. p.innerHTML = readableSize(e.loaded) + "/" + readableSize(e.total);
  41. });
  42. xhr.upload.addEventListener("load", function () {
  43. p.innerHTML='';
  44. });
  45. xhr.addEventListener('readystatechange', function(e) {
  46. if(this.readyState === 4 && this.status === 200) {
  47. element.value='';
  48. window.location.reload();
  49. }
  50. });
  51. xhr.open('PUT', f.name);
  52. xhr.overrideMimeType(f.type);
  53. xhr.setRequestHeader("Content-Type", f.type);
  54. xhr.send(f);
  55. }
  56. }
  57. //-->
  58. </script>
  59. </head>
  60. <body>
  61. <h3 class="directory">/tvbox/</h3>
  62. <h2 class="deviceName">HUAWEI STF-AL10<br/>9.09 GB / 110.65 GB</h2><br/>
  63. <div id="content" style="font-size:11px">
  64. <div><input id="fil" name="fil" type="file" size="30" style="width:600px;margin-bottom:15px"/></div>
  65. <div><input type="button" class="sbtn" value="上传" onclick="javascript:startUpload();"/></div>
  66. <div><span id="progress"></span></div>
  67. </div>
  68. <!-- Share -->
  69. <div style="display:none"><a target="_blank" href="">下载</a></div>
  70. <br/>
  71. <br/>
  72. </body></html>