Skip to content
Advertisement

How make default profile picture in express js

How can I can make default profile picture when the user have not upload there picture? I want to display default profile picture for them, like png.
I have done some thing similar in php but I don’t know how to change it to nodejs express code. This is what have done in php:

JavaScript

How can I change it to express code? Please help me by saving my days. Thanks

Advertisement

Answer

If your using mongoose in your user model make a field for profile picture and you can set a default value

Example

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement