expressjs/multer

Multer is not writing the file directly in the folder

Open

#531 opened on 2017年10月5日

GitHub で見る
 (5 comments) (0 reactions) (0 assignees)JavaScript (11,136 stars) (1,043 forks)batch import
awaiting more infohelp wanted

説明

Hello, I am uploading files dynamically (different folders based on need):

// Configure multer
let upload = multer({
  storage: multer.diskStorage({
    destination: (req, file, callback) => {
      let homefolder = req.body.folder;
      callback(null, homefolder);
    },
    filename: (req, file, callback) => {
      let filename = req.body.filename;
      callback(null, filename);
    }
  })
});

router.post('/upload', upload.single('file'), ctrlFileUploader.upload);

This is working well, the issue I have noticed is that multer doesn't write the file there exactly, it kinda waits for the file to be uploaded completely and then starts writing the file to the folder. Is this normal or I am doing something wrong?

コントリビューターガイド

Multer is not writing the file directly in the folder · expressjs/multer#531 | Good First Issue