Skip to content

Commit 11c5e98

Browse files
committed
done
1 parent 3c14b0e commit 11c5e98

File tree

9 files changed

+2
-2
lines changed

9 files changed

+2
-2
lines changed

upload a file using multer/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ app.post('/api/upload',function(req,res){
6262
res.render('index',{msg : err});
6363
}
6464
else{
65-
if(res.file==undefined){
65+
if(req.file==undefined){
6666
res.render('index',{msg :'error : no file selected'});
6767
}
6868
else{
6969
res.render('index',{
7070
msg: 'file uploaded',
71-
file: `/uploads/${req.file.filename}`
71+
file: `uploads/${req.file.filename}`
7272
});
7373
}
7474
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

upload a file using multer/public/uploads/myImage-1593333292083.jpg renamed to upload a file using multer/public/uploads/myImage-1593334604615.jpg

File renamed without changes.

upload a file using multer/public/uploads/myImage-1593334105465.jpg renamed to upload a file using multer/public/uploads/myImage-1593334663278.jpg

File renamed without changes.

0 commit comments

Comments
 (0)