添加和检索音频

时间:2019-03-15 04:24:11

标签: express multer

我已经使用Node在MongoDB中添加并检索了图像。可以对我的代码进行一些调整吗?建议我。

upload.ts

track_list_top100 = track_list_top100.annotate(
    highestpos=Min('rank__pos', filter=Q(rank__charttype='total'))
)

image.controller.ts

var multer = require("multer");
export let UPLOAD_PATH = "uploads";
const storage = multer.diskStorage({
  destination: function(req, file, cb) {
    req;
    file;
    cb(null, UPLOAD_PATH);
  },
  filename: function(req, file, cb) {
    req;
    cb(null, file.fieldname + "-" + Date.now() + ".jpg");
  }
});
export const upload = multer({ storage: storage }).single("avatar");

是否可以使用经过修改的相同代码通过Mongo中的Node,Express添加和检索音频文件?

0 个答案:

没有答案