How to send pdf to mongoDB from the front-end?

Hello! I am trying to send an obj that also has a pdf from the front-end to the database. I use formData API but the value for the pdf is undefined when I send it.
Do you know how can I send the pdf properly??

i dont know why but i think that it will gonna help you!

Thank you for sharing but this isn’t what I can’t do. I can make the post request but I can’t send the pdf file. I want to send that one too.

well maybe this?

So are you logging on the frontend, and that’s literally the object that has been constructed by your form (+ whatever else you adding in there)?

What does the code look like for the form data post request?

It isn’t what I need but thanks anyway, I solved it.

In the end I solved it, :confused: not as I wished but it works. Thank you for taking time and answer here!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.