File Path not working and if fileName is provided it downloads it in the Downloads Section
import writeXlsxFile from "write-excel-file";
export default async function createFile(result){ let header_row=[] let data_row=[]
for(let i=0;i<result.length;i++){
let obj_h={value:result[i].Qtype,fontWeight:'bold'}
let obj_d={value:result[i].Ans,type:Number}
header_row=[...header_row,obj_h]
data_row=[...data_row,obj_d]
}
const data=[
header_row,data_row
]
await writeXlsxFile(data,{
filePath:"./Output.xlsx"
})
}
I am not sure why the file isn't being created at the specified file directory in which I want to create the file....and I am using NextJs