-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUploadFile.json
More file actions
97 lines (97 loc) · 2.71 KB
/
Copy pathUploadFile.json
File metadata and controls
97 lines (97 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[
{
"id": "upload_file_tab",
"type": "tab",
"label": "Upload a file",
"disabled": false,
"info": "Reads a file from disk and sends it to a chat.\n\n`file in` produces a Buffer in msg.payload and the path in msg.filename, which is exactly what the upload node needs — a Buffer carries no name of its own, so msg.filename is required.\n\nFor large files send the path instead of the Buffer: set `file in` to output a filename only, or put the path straight into msg.payload. Telegram then streams it from disk rather than the flow holding the whole file in memory.\n\nIt sends to your own Saved Messages; put a username under \"Send to\" to send somewhere else."
},
{
"id": "upload_trigger",
"type": "inject",
"z": "upload_file_tab",
"name": "send it",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"once": false,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 120,
"wires": [["upload_read"]]
},
{
"id": "upload_read",
"type": "file in",
"z": "upload_file_tab",
"name": "read the file",
"filename": "/tmp/report.pdf",
"filenameType": "str",
"format": "",
"chunk": false,
"sendError": true,
"encoding": "none",
"allProps": false,
"x": 330,
"y": 120,
"wires": [["upload_name"]]
},
{
"id": "upload_name",
"type": "change",
"z": "upload_file_tab",
"name": "name it",
"rules": [
{
"t": "set",
"p": "filename",
"pt": "msg",
"to": "report.pdf",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 510,
"y": 120,
"wires": [["upload_send"]]
},
{
"id": "upload_send",
"type": "telegram client upload",
"z": "upload_file_tab",
"name": "upload",
"bot": "",
"peer": "me",
"caption": "Here is the report",
"forcedocument": true,
"x": 680,
"y": 120,
"wires": [["upload_debug"]]
},
{
"id": "upload_debug",
"type": "debug",
"z": "upload_file_tab",
"name": "sent message",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 860,
"y": 120,
"wires": []
}
]