In this question, images uploaded through multipart/form-data parsers are saved in a temp folder const tempPath = req.file.path
. Then they are copied to a specified directory const targetPath = path.join(__dirname, "./uploads/image.png");
Those images then can be displayed like <img src="/uploads/image.png" />
I understand that browser cannot display an image in system's temp folder. Is there another way to display images without copying them like above? Can I convert req.file
to be displayed in <img />
?