CSV download works well on Mac, but isn’t functioning as expected on Windows

I have a JS Script that looks like this:

(() => {
	getCSVData.trigger({
    onSuccess: (data) => {
      utils.downloadFile(data, 'report', 'csv')
    }
  })
})()

This is working correctly on Mac, but using Firefox on Windows will show the download prompt but not recommend any application (Excel) to open the file with. You can select Save File and open it manually, but not directly by selecting Excel in the download prompt.
This behavior seems to be caused due to the file being downloaded having the MIME type of text/plain instead of text/csv.
I tried writing JS to download the file, but it seems like Retool does not allow this due to sandboxing.
Is there any way of specifying the MIME type of the file that will be downloaded, or is there any workaround for this?

Hey puffpuddy, Unfortunately, there isn't a way to specify the MIME type of the file that will be downloaded when downloading a file from Retool and I'm not aware of a good way to work around this issue in Retool :slightly_frowning_face: I will pass along a report of this issue to engineering internally. I'm not able to provide a timeline of when we might have a fix for this issue at the moment but I'll notify you in this post of any updates. My suggested workaround would be what you've described; to Save the File and open it manually. I wish I had better news!

To specify the MIME type of the file that will be downloaded, you may want to check the configuration or settings in your JavaScript framework or Retool if there's an option to set the MIME type explicitly.
If you're unable to configure the MIME type directly, you might consider renaming the downloaded file with a ".csv" extension to hint to Windows that it should be opened with Excel.
Additionally, for more Windows-related tips and solutions, you can check out the cheap Windows 10 key subreddit. They often have useful information and discussions that could provide insights into Windows-specific issues.