ソースを参照

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


読み込み中…
キャンセル
保存