Hello,
The Store Attachment function in the attached flow is not defining the filename while trying to save a gmail attachment. The result of the flow creates filename: "../../mnt/BreachMedia/undefined" and will not store the "Sterile Door.jpg" into the "./../mnt/BreachMedia/". I can confirm with another flow that I can indeed store into the directory shown. Any guidance would b helpful.
Here are the debug logs
3/5/2019, 1:14:56 PMnode: Filter
Sterile Exit Wrong Way : msg : Object
object
payload: "Sterile Exit Wrong Way↵01:14 PM, 2019-03-05"
topic: "Sterile Exit Wrong Way"
date: "2019-03-05T19:14:44.000Z"
header: object
from: "exacqvision-cll@astin.us"
attachments: array[1]
0: object
contentType: "image/jpeg"
transferEncoding: "base64"
contentDisposition: "attachment"
fileName: "Sterile Door.jpg"
generatedFileName: "Sterile Door.jpg"
contentId: "ef17b59d012ac560aaea2101bb3f267a@mailparser"
checksum: "b3a3949dd1073b7643b01fbc48c73a1d"
length: 172037
content: buffer[172037]
_msgid: "4812fa08.3c5b04"
_event: "node:409e8e9e.a454e"
3/5/2019, 1:14:56 PMnode: Store
Sterile Exit Wrong Way : msg : Object
object
topic: "Sterile Exit Wrong Way"
date: "2019-03-05T19:14:44.000Z"
header: object
from: "exacqvision-cll@astin.us"
attachments: array[1]
0: object
contentType: "image/jpeg"
transferEncoding: "base64"
contentDisposition: "attachment"
fileName: "Sterile Door.jpg"
generatedFileName: "Sterile Door.jpg"
contentId: "ef17b59d012ac560aaea2101bb3f267a@mailparser"
checksum: "b3a3949dd1073b7643b01fbc48c73a1d"
length: 172037
content: buffer[172037]
_msgid: "4812fa08.3c5b04"
_event: "node:409e8e9e.a454e"
parts: object
filename: "../../mnt/BreachMedia/undefined"
Here is the flow
[
{
"id": "42b14509.52d85c",
"type": "function",
"z": "cd3efe20.4f582",
"name": "Store Attachment",
"func": "msg.filename = \"../../mnt/BreachMedia/\"+msg.payload.fileName;\nmsg.payload = msg.payload.content;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 350,
"y": 1220,
"wires": [
[
"9cdee59a.46a8e8",
"faf0c732.0b2898"
]
]
},
{
"id": "9cdee59a.46a8e8",
"type": "file",
"z": "cd3efe20.4f582",
"name": "Write attachement",
"filename": "",
"appendNewline": false,
"createDir": true,
"overwriteFile": "true",
"x": 352.99998474121094,
"y": 1263.9999551773071,
"wires": [
[]
]
},
{
"id": "ee963462.056188",
"type": "split",
"z": "cd3efe20.4f582",
"name": "",
"splt": "",
"x": 310.99999618530273,
"y": 1181.9999933242798,
"wires": [
[
"42b14509.52d85c",
"d50fb267.7ce93"
]
]
},
{
"id": "dbf67f61.c6304",
"type": "debug",
"z": "cd3efe20.4f582",
"name": "Filter",
"active": true,
"console": "false",
"complete": "true",
"x": 570,
"y": 1140,
"wires": []
},
{
"id": "d50fb267.7ce93",
"type": "debug",
"z": "cd3efe20.4f582",
"name": "Split",
"active": true,
"console": "false",
"complete": "true",
"x": 570,
"y": 1180,
"wires": []
},
{
"id": "faf0c732.0b2898",
"type": "debug",
"z": "cd3efe20.4f582",
"name": "Store",
"active": true,
"console": "false",
"complete": "true",
"x": 570,
"y": 1220,
"wires": []
},
{
"id": "ede31fd2.bcaee",
"type": "switch",
"z": "cd3efe20.4f582",
"name": "exacqvision-cll",
"property": "from",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "exacqvision-cll",
"vt": "str"
}
],
"checkall": "true",
"outputs": 1,
"x": 280,
"y": 1140,
"wires": [
[
"ee963462.056188",
"dbf67f61.c6304"
]
]
}
]