Ver código fonte

what if you just assigned Buffer to the JS object?

master
Rich Brown 1 ano atrás
pai
commit
07d7cd09e3
1 arquivos alterados com 2 adições e 2 exclusões
  1. +2
    -2
      routes/createRouter.js

+ 2
- 2
routes/createRouter.js Ver arquivo

@@ -30,7 +30,7 @@ createRouter.post('/form', upload.single('file'), (req, res) => {
const { file, body: { title, body, arrayOfTags } } = req;

console.log(file, body, title, arrayOfTags);
console.log(file.buffer.toString());
console.log(file.buffer);

return req.app.locals.mp
.create(
@@ -39,7 +39,7 @@ createRouter.post('/form', upload.single('file'), (req, res) => {
name: title, // i thought MF syntax was 'p-name' but voxpelli's formattr turns NAME to TITLE
content: body,
category: arrayOfTags,
photo: file.buffer.toString(),
photo: file.buffer,
},
'multipart',
)


Carregando…
Cancelar
Salvar