m4nuC / async-busboy

Promise based multipart form parser for KoaJS
MIT License
167 stars 58 forks source link

can i get the file's size ? #15

Closed kid-wumeng closed 7 years ago

kid-wumeng commented 7 years ago

hi, i has a question

for example:

{fields, files} = await asyncBusboy(ctx.req)

i can get the mime, path, filename and others information of files[0] but the file's size.

how to get size? is must to use the fs.stat(path) or read to buffer ?

dominhhai commented 7 years ago

You have to use fs.stat(PATH). files array includes list of file ReadStream, so you can not get the file size by using it.

kid-wumeng commented 7 years ago

@dominhhai ok, thanks