js读取文件夹

该页面展示了如何使用HTML5和JavaScript从浏览器上传大量文件到服务器。它适用于Chrome和Firefox浏览器。主要技巧包括:在Chrome中使用`webkitdirectory`属性选择整个目录,在Firefox中使用`multiple`属性选择多个文件;利用XMLHttpRequest对象进行HTTP POST上传并显示进度条。代码受到StackOverflow和Matlus文章的启发。
摘要由CSDN通过智能技术生成


<!DOCTYPE html>
<html>
<head>
    <title>Mass File Upload Using HTML 5 and JavaScript</title>
    <style type="text/css">
        table.zaklad {
            border-collapse: collapse;
            margin: 5px;
        }


        table.zaklad th, table.zaklad td {
            border: solid 1px black;
            padding: 4px;
        }


    </style>
<!-- Google analytics -->
<script type="text/javascript">


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1281621-11']);
  _gaq.push(['_trackPageview']);


  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>


</head>
<body>
<h1>Mass File Upload Using HTML 5 and JavaScript</h1>


This page demonstrates how to upload a large number of files from a browser to a server. It works in Chrome
and Firefox browsers. There are two tricks in use:
<ul>
 <li> In Chrome, a file input field with <code>webkitdirectory</code> attribute can select a whole directory,
    while in Firefox, a file input field with <code>multiple</code> attribute can select multiple files.
 <
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值