Some Notes for this PR:
The file upload in post-review.ejs works and is linked to the database!
I installed multer to help handle this type of form data; when you update your local repos you'll probably need to run npm install or npm rebuild
I created a testing route ('/test') which can be deleted later but shows how I was passing the image field from the database to the file image.ejs (which is also a test file and can be deleted later).
Here's how I ended up implementing the upload functionality:
I got the image buffer from the form in post-reviews.ejs and saved it to an /images folder in public
I used the image buffer to write a new .jpg file into images folder
Edited the path information so that the frontend is able to access the image just by saying something along these lines from the database: res.render('image', {image: response.photo})
Future Implementation:
It's pretty redundant to be saving both the image buffer and .jpg in the images folder, but it's how I was able to get this working for now
I wanted to edit this to automatically crop the image being uploaded too so it's easier to handle on the frontend, but figured we can save this for a later step
Some Notes for this PR: The file upload in post-review.ejs works and is linked to the database!
Here's how I ended up implementing the upload functionality:
Future Implementation: