瀏覽代碼

what if you just assigned Buffer to the JS object?

master
Rich Brown 1 年之前
父節點
當前提交
07d7cd09e3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      routes/createRouter.js

+ 2
- 2
routes/createRouter.js 查看文件

@@ -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',
)


Loading…
取消
儲存