美文网首页前端知多少
web文件夹上传(原理)

web文件夹上传(原理)

作者: 孙悟空SUN | 来源:发表于2020-01-19 17:27 被阅读0次
    v2-6773191095ae169d55c178a0dddee77b_1200x500.jpg
    
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>upload dialog</title>
    </head>
    <body>
    <input id="dialog" type="file" webkitdirectory />
    <script>    
    dialog.onchange = function(e) {        
       var files = this.files;        
      var table = {};
       for (var i = 0; i < files.length; i++) {            
          var f = files[i];            
          var dt = new Date(f.lastModified);
          table[i] = {                
               path: f.webkitRelativePath,                
               size: f.size,                
               modified: dt.toLocaleString()            
           };        
        }
            console.table(table);    
    };
    </script>
    </body>
    </html>
    
    

    相关文章

      网友评论

        本文标题:web文件夹上传(原理)

        本文链接:https://www.haomeiwen.com/subject/cnorzctx.html