Posts

Showing posts from 2017

FIXING "UNABLE TO CONNECT TO WEB SERVER 'IIS EXPRESS'."

Image
Delete your web application’s  .vs\applicationhost.config  and try again. Then, in your project settings, change the  App URL  port to something new: Launch your app. You can change the  App URL  back again afterwards, this just ensures VS will regenerate your  applicationhost.config . Enjoy!

Javascript: Calcuate MD5 hash of a large file

function process () { getMD5 ( document . getElementById ( "my-file-input" ). files [ 0 ], prog => console . log ( "Progress: " + prog ) ). then ( res => console . log ( res ), err => console . error ( err ) ); } function readChunked ( file , chunkCallback , endCallback ) { var fileSize = file . size ; var chunkSize = 4 * 1024 * 1024 ; // 4MB var offset = 0 ; var reader = new FileReader (); reader . onload = function () { if ( reader . error ) { endCallback ( reader . error || {}); return ; } offset += reader . result . length ; // callback for handling read chunk // TODO: handle errors chunkCallback ( reader . result , offset , fileSize ); if ( offset >= fileSize ) { endCallback ( null ); return ; } readNext (); }; reader . onerror = function ( err ) { endCallback ( err || {...