Here you can see the code:
I tested it in Chrome 56 and Internet Explorer 11 and it worked.
IMPORTANT: If you want to upload other kind of documents (more that 2 MB). Then I recommend you take a look to this post: http://sharepointcookies.com/2017/02/programmatically-uploading-large-files-client-side-to-sharepoint-2013/ from my colleague Kev.
Please, write a comment if that’s not working in your specific scenario!