Closed ozgreat closed 2 years ago
Just read or also write it to somewhere? There are various ways to read the body. For small files you could just do:
const {buffer} = require('micro');
...
const data = await buffer(req);
Just read or also write it to somewhere? There are various ways to read the body. For small files you could just do:
const {buffer} = require('micro'); ... const data = await buffer(req);
I wanna upload them to s3, but when I try to fs.writeFile(fileName, buf, err => console.log(err)) file is broken
Just want to know that anyone contribute to this repo
@ozgreat Micro is designed to be minimal and simplistic. You either need to write your own modules or use community modules.
You mention you do not want to use micro-upload
? You do not mention why you do not want to use this. Maybe as you expect a posted binary file?
I know that the currently published
micro-upload
is old and fails npm audits. The repo has a dependabot branch that alleviates this, easily defined in package.json..
For your use case...
Closing as stale - if you're open to contributing, I'd be happy to review a PR!
I wanna read a file from req, how can I do it? I don't wanna use micro-upload