Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

multer save file with extension

var multer = require('multer');
var path = require('path')

var storage = multer.diskStorage({
  destination: function (req, file, cb) {
    cb(null, 'uploads/')
  },
  filename: function (req, file, cb) {
    cb(null, Date.now() + path.extname(file.originalname)) //Appending extension
  }
})

var upload = multer({ storage: storage });
Comment

PREVIOUS NEXT
Code Example
Javascript :: india pincode regex 
Javascript :: update nodejs mac 
Javascript :: how to check if a number is float javascript 
Javascript :: BROWSER=none npm start exited with code 1 
Javascript :: js fullscreen 
Javascript :: tone mapping three js 
Javascript :: javascript onkeyup multiple classes 
Javascript :: array to string js 
Javascript :: edit json via nodejs 
Javascript :: javascript filesystem 
Javascript :: moment js day name language 
Javascript :: js window dimensions 
Javascript :: batch md 
Javascript :: Statements and Expressions 
Javascript :: css font size jsx 
Javascript :: node js get data from mysql 
Javascript :: react native run ios select simulator 
Javascript :: how to check array is sorted or not in javascript 
Javascript :: file input disable open file picker javascript 
Javascript :: learn gram js 
Javascript :: como pegar as propriedades css de um elemento :after html com js 
Javascript :: stop freeScroll in flickty 
Javascript :: htaccess to deploy react app to cpanel 
Javascript :: disable enter on input field react 
Javascript :: bq show pretty json 
Javascript :: Node Sass version 5.0.0 is incompatible with ^4.0.0. 
Javascript :: nodejs sharp resize to max width or height 
Javascript :: jq count outputs 
Javascript :: find array object value is already in use 
Javascript :: js string search 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =