expressjs / expressjs/multer

Update/Replace multiple image In multer

Open
#590 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
1.1k
Avg merge
8d 2h
Merged PRs (30d)
21

Description

how to update /replace image in Multer

My upload codes work fine

```js
var multer = require('multer');
var storage = multer.diskStorage({
destination:function(req,file,cb){
cb(null,"/home/plexihea/web/plexihealth.com/public_html/doctor/images/clinic/")
},
filename: function(req,file,cb){
cb(null,Date.now() + file.originalname);
}
});
var upload = multer({ storage:storage });

app.route('/add_user')
.post(upload.any(),user.create_a_user);
```

same thing I did it to update
When i update same image which is store in the storage
i got error " Cannot read property 'filename' of undefined
"
i

Contributor guide

Open the contributing guide

Research direction

Start with the shown app.route('/add_user') handler, upload.any(), and user.create_a_user callback, then reproduce the update request that raises "Cannot read property 'filename' of undefined." Inspect the uploaded-file data and define the expected behavior for replacing an existing image before determining what change and verification are needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.