Browse Source

buffer to string?

master
Rich Brown 1 year ago
parent
commit
e3ab6fa02e
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      routes/createRouter.js

+ 2
- 2
routes/createRouter.js View File

@@ -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(typeof file);
console.log(file.buffer.toString());

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,
photo: file.buffer.toString(),
},
'multipart',
)


Loading…
Cancel
Save