How do I pass a blob from frontend to backend api?
Unanswered
Burmese posted this in #help-forum
BurmeseOP
I'm working on a project using next.js pages directory and langchain's pdf loader. I would like to pass a pdf from frontend to my api so that I can read the contents, create embeddings and store the vectors. I would not like to store the pdf itself. Is there an approach to this that I could work off?
1 Reply
Make a regular fetch call and specify a content type of
application/octet-stream as this is the default for binary files. You can find out more about it here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#important_mime_types_for_web_developers