mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Unify file name for binary attachment in e-mail node (#619)
This commit is contained in:
parent
9cc3d237fb
commit
12be92e06f
@ -103,7 +103,7 @@ module.exports = function(RED) {
|
||||
if ((msg.payload[0] === 0x89)&&(msg.payload[1] === 0x50)) { fe = "png"; } //4E
|
||||
msg.filename = "attachment."+fe;
|
||||
}
|
||||
var fname = msg.filename.replace(/^.*[\\\/]/, '') || "file.bin";
|
||||
var fname = msg.filename.replace(/^.*[\\\/]/, '') || "attachment.bin";
|
||||
sendopts.attachments = [ { content:msg.payload, filename:fname } ];
|
||||
if (msg.hasOwnProperty("headers") && msg.headers.hasOwnProperty("content-type")) {
|
||||
sendopts.attachments[0].contentType = msg.headers["content-type"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user