Hi, I am sending me log files every day as backup.
If I am sending it as csv there are problems with the encoding and all umlauts like ö,ä,ü and so on arent readable.
If I am sending the same text as .txt it works.
The file which I save with NodeRed works too.
The Input looks like:
{"Alarmnummer":"032","Schrittzaehler":0,"IDALL":0,"Reihungszeit":20,"Alarmtext":"24V_Störung","aktiv":false,"deactivate":false,"deactivatedate":"26.11.2021"}, {"Alarmnummer":"033","Schrittzaehler":0,"IDALL":0,"Reihungszeit":20,"Alarmtext":"Batterie MIN","aktiv":false,"deactivate":false,"deactivatedate":"26.11.2021"},
My code for the attachments look like this:
attachments=[];
for(var i=0;i<msg.payload.length;i++)
{
attachments.push({filename:msg.payload[i].path.substring( msg.payload[i].path.lastIndexOf("/") + 1, msg.payload[i].path.lastIndexOf("."))+".txt",content:msg.payload[i].payload.replace(/},/g, "},\n")});
}
msg.attachments=attachments;
Is there a solution?