SHARE
TWEET

Untitled

a guest Jun 17th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Test Opera</title>
  5.     <script src="//cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.34/dist/web3.min.js" type="text/javascript"></script>
  6.     <script src="//cdnjs.cloudflare.com/ajax/libs/js-sha3/0.8.0/sha3.min.js" type="text/javascript"></script>
  7.     <script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js" type="text/javascript" charset="utf-8" async defer></script>
  8.     <script type="text/javascript">
  9.         const web3 = new Web3(ethereum);
  10.         const storage = window.localStorage;
  11.     </script>
  12. </head>
  13. <body>
  14.     <form action="submit" method="get" accept-charset="utf-8" onsubmit="return false;">
  15.         <input type="file" onchange="hashFile(this)" id="my_document" multipe=false class="inputfile">
  16.     </form>
  17.     <script type="text/javascript">
  18.       function hashFile(el) {
  19.         var fr = new FileReader();
  20.         fr.onload = function (ev) {
  21.           console.log(26,ev,fr);
  22.           var data = ev.srcElement.result;
  23.           console.log(28, data);
  24.         };
  25.         console.log(el, el.files);
  26.         fr.readAsArrayBuffer(el.files[0]);
  27.       }
  28.   </script>
  29. </body>
  30. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top