Save images from file input in form POST method
So recently I've been learning express JS and wanted to do a simple project of making a website with a form. it will receive a name and an image. Show both after submitting the form.
The problem lies in the file input in the form. I can grab the name of the file but I don't know how to download it and save it in an assets/gallery folder to later show it. Can anyone help? Thanks
Below is the index.js code and also for added context I use hard coded array called gallery to store the data since I wanted to just focus on express and not deal with database for now.
The problem lies in the file input in the form. I can grab the name of the file but I don't know how to download it and save it in an assets/gallery folder to later show it. Can anyone help? Thanks
Below is the index.js code and also for added context I use hard coded array called gallery to store the data since I wanted to just focus on express and not deal with database for now.
