-
Notifications
You must be signed in to change notification settings - Fork 16
/
multer.express.txt
42 lines (38 loc) · 3.41 KB
/
multer.express.txt
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
MULTER
MULTER(OBJ) #Express MIDWR (0.1.3) for received body "multipart/data" with filename and using POST|PUT that:
# - saves them on disk
# - creates REQ.files { NAME: FILE_OBJ }
# - fieldname NAME
# - originalname STR: filename="..."
# - path: path on dest DIR
# - extension STR: of path
# - name STR: of path
# - encoding STR
# - mimetype STR: Content-Type
# - size NUM
# - truncated BOOL: if truncated because of limits
#Uses BUSBOY (not MULTIPARTY)
#OBJ:
# - dest DIR (def: OS.tmpDir()): where to upload
# - rename FUNC(NAME, FILENAME)->FILENAME2: change default filename:
# - otherwise random
# - will still add original filename extension
# - e.g. using field NAME, FILENAME or timestamp
# - limits OBJ:
# - fieldNameSize NUM (def: 100)
# - fieldSize NUM (def: 1MB)
# - fields NUM (def: Infinity)
# - fileSize NUM (def: Infinity)
# - files NUM (def: Infinity)
# - parts NUM: fields + files (def: Infinity)
# - headerPairs NUM: number of headers (def: same as HTTP)
# - defCharset (def: "utf8")
# - highWaterMark|fileHwm NUM: OSTREAM|ISTREAM.highWaterMark
# (max. buffer, def: same as OSTREAM|ISTREAM (16KB))
# - onFileUploadStart|Complete(FILEOBJ)
# - onFileUploadData(FILEOBJ, BUFFER|STR): when getting chunks of data
# - onParseStart|End()
# - onError(ERROR, NEXT())
# - onFiles|Fields|PartsLimit()