apache / couchdb

Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
https://couchdb.apache.org/
Apache License 2.0
6.17k stars 1.03k forks source link

Document Creating Multiple Attachments Using A Web Browser #4648

Open ronnievsmith opened 1 year ago

ronnievsmith commented 1 year ago

Summary

The documentation shows that it is possible to load multiple attachments in a single HTTP PUT, the Content-Type being multipart/related. Web browser methods XMLHTTPRequest and Fetch do not natively produce HTTP requests with this Content-Type.

Desired Behaviour

Publish JavaScript illustrating how to PUT multiple attachments in a single request to CouchDB.

NOTE: I tried to proxy a request crafted with FormData() through Node.js and simply rewrite the Content-Type (keeping the boundary) but this fails with a 500 error.

ronnievsmith commented 1 year ago

BTW, Project Fauxton does not support (illustrate) multi file uploads. In other words, there does not seem to be a working example available.