0

Im trying to download a pdf file stored in mongodb using gridfs andmulter , I am recieving a stream back which when I downloaded and open the pdf file would be corrupted here is my backend for downloading it [My backend is node js and frontend is react js ].

here is my backend code

enter image description here

here is my frontend code

enter image description here

here is the response that i recieved enter image description here

this is what the response.data would look like

enter image description here

lastly this is what the error looks like when I opened one of those downloaded files

enter image description here

please do help me out ive been struggling in the past two days to find a solution to this

0 Answers0