zoukankan      html  css  js  c++  java
  • 图片通过转base64上传

      var file = files[0];  
           var reader = new FileReader();  
           reader.onload = function()  
           {  
               document.getElementById("filecontent").innerHTML = this.result;  
           };  
           reader.readAsText(file);

    <html>
      <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <meta name="author" content="oscar999">
      <title></title>
      <script>
      function  handleFiles(files)
      {
        if(files.length)
        {
           var file = files[0];
           var reader = new FileReader();
           reader.onload = function()
           {
               document.getElementById("filecontent").innerHTML = this.result;
           };
           reader.readAsText(file);
        }
      }
      </script>
      
      </head>
      <body>
     
      <input type="file" id="file" onchange="handleFiles(this.files)"/>
      <div id="filecontent"></div>
      </body>
    </html>
    

      

    http://blog.csdn.net/oscar999/article/details/37499743

  • 相关阅读:
    sqlserver中压缩日志文件
    git命令的使用
    c#开发wps插件(3)部署
    c#开发wps插件(2)
    小王子
    唯一的!!!
    小王子
    MySql命令行修改密码
    MacOS下Lucene学习
    企业权限管理(SSM整合)(总结)
  • 原文地址:https://www.cnblogs.com/wangyuyanhello/p/8427492.html
Copyright © 2011-2022 走看看