Canvas to file. Say you have a canvas: var canvas = document.