Похожие чаты

Const storage = multer.diskStorage({ destination: function (req, file, cb)

{
cb(null, "./uploads");
},
filename: function (req, file, cb) {
cb(null, file.fieldname + "-" + Date.now());
},
});

Like this?

7 ответов

5 просмотров
Muhammad-Arsalan Автор вопроса

after inerting this code the filename changes to a string with a date.

Try: cb(null, Date.now() + '-' + file.originalname);

Muhammad-Arsalan Автор вопроса
Thomas
^ read again

It worked👏👏

Muhammad Arsalan
screenshot nope didn't worked

Hint: it's NOT "featured"

Похожие вопросы

Обсуждают сегодня

Карта сайта