I start with a document located in localhost:5984/categories/Jan with the following data:
{ "_id": "Jan", "_rev": "4-2c0b1c27daca6d2a3c375b0f879a8967", "name": "Jan", }
I want to load a pdf document into this document, so I give the following curl command:
curl -vX PUT 'http://localhost:5984/categories/Jan/example.pdf?rev=4-2c0b1c27daca6d2a3c375b0f879a8967' -d@example.pdf -H "ContentType: application/pdf"
And I get this answer:
* Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 5984 (
It seems to me that this is a successful download. However, when I visit the localhost:5984/categories/Jan/example.pdf url localhost:5984/categories/Jan/example.pdf , there are two problems:
- instead of opening in a browser, I’ll be asked to download an attachment
- When I download and open the attachment, it says that the data cannot be read.
This happens for content types other than pdf files (I also tried w / png). Can someone tell me what could be wrong? Thanks.
source share