const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, './uploads/')
},
filename: function (req, file, cb) {
cb(null, `${file.fieldname}-${Date.now()}-${file.originalname}`)
},
})
const upload = multer({ storage: storage })
@Controller('/')
class UploadController {
@Flow([upload.single('image')])
@Post('/upload')
upload(@File() files: Record<string, File>) {
console.log(files)
}
}
this is my code that doesn't give any errors at all. I get the file in logs, but I can't upload it.
Without using amala with only koa, everything works fine. I assume that the problem is a different way of processing the request, since it is impossible to access the fields through amala
originalname
fieldname and etc...
Therefore, multer receives incorrect data, I cannot solve the problem in any way.
is there a way to make friends with amala and multer?
this is my code that doesn't give any errors at all. I get the file in logs, but I can't upload it.
Without using amala with only koa, everything works fine. I assume that the problem is a different way of processing the request, since it is impossible to access the fields through amala
originalname
fieldname and etc...
Therefore, multer receives incorrect data, I cannot solve the problem in any way.
is there a way to make friends with amala and multer?