Node/Multer Get Filename

前端 未结 6 1839
甜味超标
甜味超标 2021-02-03 21:45

I am using the following to upload files to a directory via Multer. It works great, but I need to perform some actions after upload that require the name of the file I just post

6条回答
  •  遇见更好的自我
    2021-02-03 22:21

    var express=require("express");
    var app=express();
    var multer=require("multer");
    var upload=multer({dest:"uploads/"});
    app.post("/multer", upload.single("file"), function(req,res){
        console.log(req.file.filename);
    });

提交回复
热议问题