I tired the option window.showSaveFilePicker(), but it is saving as empty file. It overwrites with empty data. I have to save a html report.
funtion save()
{
async function getNewFileHandle() {
const options = {
types: [
{
description: 'Text Files',
accept: {
'text/plain': ['.txt'],
},
},
],
};
const handle = await window.showSaveFilePicker(options);
return handle;
}
}