From http://divingintodart.blogspot.ae/2013/09/download-client-side-data-as-file-using.html