handler: async (ctx) => {
const parts = ctx.request.parts;
let part;
try {
while ((part = await parts)) {
// handle files at the first place
part.pipe(someOtherStream);
}
} catch (err) {
}
// we need to use fields data first
console.log(parts.field.name);
}
we need to use fields data first, such as check username/password.
if the request is valid, then upload file to third party file storage service, like Azure-Blob-Storage
we need to use fields data first, such as check username/password.
if the request is valid, then upload file to third party file storage service, like Azure-Blob-Storage
here is a solution that can work:
but we wonder if there is a better way, that can copy filestream for later use..