PrimeAcademy / shawl-syllabus

1 stars 2 forks source link

Upload Process - Question on Best Approach #16

Closed victoriamertens closed 1 year ago

victoriamertens commented 1 year ago

Description

Victoria Mertens

What do you want to happen?

Ideally, for the photo upload I would like multer not to run the file upload alongside the upload to s3 but I have yet to figure out how to accomplish that. The only thing I have come across is being able to delete it out of the the file structure after the upload occurs using fs, but that doesn't seem the most efficient or best practice.

Screenshots / Code Snippets

Screen Shot 2023-01-12 at 8 59 34 AM

Screen Shot 2023-01-12 at 8 59 54 AM

Screen Shot 2023-01-12 at 9 00 21 AM

I have included some snippets, but it might be easier to see on my pushed code.

Link to the router: https://github.com/victoriamertens/happy-closet-solo-proj/blob/main/server/routes/upload.router.js

What did you try? Who did you ask?

I did a lot of searching to see if theres was a multer function other than upload.single('file') that would allow me to access req.file without having put the file into the fs but I couldn't find any.

I couldn't find any resources that were using multer not to upload a file to the file system, and the docs didn't seem to have that feature.

What branch is your code on? Did you git push?

(https://github.com/victoriamertens/happy-closet-solo-proj/blob/main/server/routes/upload.router.js)