createObjectURL fallback for multi-browser support
// https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications
// http://stackoverflow.com/a/11277737/907388
function createObjectURL ( file ) {
if ( window.webkitURL ) {
return window.webkitURL.createObjectURL( file );
} else if ( window.URL && window.URL.createObjectURL ) {
return window.URL.createObjectURL( file );
} else {
return null;
}
}
// works cross-browser
var url = createObjectURL( file );