Create and download a file in javascript