<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">

<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="apple-mobile-web-app-status-bar-style" content="black">

<meta name="format-detection" content="telephone=no">

<title>多个文件上传</title>

</head>

<body>

<div style="height: 100px; width: 100px; border: 1px solid red; position: relative;">

点击上传

<input onchange="uploadFile()" id="upload" multiple="multiple" type="file" accept="image/*;capture=camera" style="height: 100px;width: 100px;opacity: 0;position: absolute;top: 0;left: 0;" />

</div>

<script>

function uploadFile() {

var input = document.getElementById('upload');

var files = Array.prototype.slice.call(input.files);

files.forEach(function(file, i) {

var reader = new FileReader();

reader.onloadend = function(e) {

var baseFileStr = this.result.substring((13 + file.type.length),this.result.length);

console.info("输出文件数据");

console.info(baseFileStr);

}

reader.readAsDataURL(file);

});

}

</script>

</body>

</html>

>>>输出文件数据

>>>iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2...

最新文章

  1. ActiveMQ 简单搭建
  2. Java 日期加减计算.
  3. string.Format格式化
  4. ExtJs Ext.panel.Panel和Ext.container.Viewport布局问题
  5. c/c++ 重载 数组 操作符[] operator[ is ambiguous, as 0 also mean a null pointer of const char* type.
  6. 【转】 U3D DrawCall优化手记 - 夜阑卧听风吹雨
  7. md5实现
  8. linux新建磁盘并分区
  9. Oracle判断指定列是否全部为数字
  10. linux---Vim命令集
  11. Linux双网卡NAT共享上网
  12. Chapter 2 Open Book——16
  13. C语言5种存储区域
  14. jpa报错:Table &#39;dev-test.hibernate_sequence&#39; doesn&#39;t exist
  15. Python 3 基本操作列举
  16. jvm(转)
  17. Jnekins+Gitlab代码提交全程配置
  18. 利用vue-cli3快速搭建vue项目详细过程
  19. VNC远程连接阿里云Linux服务器 图形界面
  20. vs2017调试浏览器闪退

热门文章

  1. 葵花宝典之机器学习:全网最重要的AI资源都在这里了(大牛,研究机构,视频,博客,书籍,Quora......)
  2. CentOS 7安装过程
  3. HDU 3987 &amp;&amp; DINIC
  4. JS禁用右键+禁用Ctrl+u+禁用F12
  5. Linux学习笔记——例说makefile 索引博文
  6. 【转】selenium自动化测试环境搭建
  7. hdu 1698 Just a Hook 基本线段树
  8. linux for LVM 创建笔记
  9. 如何用jquery+ajax写省市区的三级联动?(封装和不封装两种方式)-----2017-05-14
  10. java三大版本解析