Until all modern browsers support the download link attribute, using this hidden form is the best way to generate a file download directly from JavaScript.