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?