4

If I understand correctly your want to upload a file from the client machine to the web application using the standard HTML tag <input type="file"> and then hash the content of the file. Your code is actually hashing the full path of the file. If you want to read the content of a file, I recommend to use FileReader like this: HTML: <div> &...


2

check this question - https://stackoverflow.com/questions/5786851/define-global-variable-in-a-javascript-function If web3 is not defined as a global variable, but you have "web3 = new Web3(web3.currentProvider)" inside a function - the web3 object will be local for that function only, while with window.web3 it will be globaly accessible


Only top voted, non community-wiki answers of a minimum length are eligible