Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Cloudant Document Creation Error - 413 (Request Entity Too Large) #345

Closed
chintankshah opened this issue Feb 5, 2017 · 2 comments
Closed
Labels

Comments

@chintankshah
Copy link

Hi,

I've created a Bluemix App and using cloudantNoSQLDB service with a lite plan. Now one of my document is in excess of 5 mb (as it contains a few base64 encoded data of images) and when I try to create the doc, I get this 413 - Request Entity Too Large error.

Is it the type of plan I have that's restricting me to create documents of this big size? Please help.

@ricellis
Copy link
Member

ricellis commented Feb 6, 2017

@chintankshah
Yes, as per #317 (comment) I believe the Cloudant service on Bluemix is limited to 1 MB in a single request. You may be able to workaround the limit by uploading your document and attachments in separate requests.
For example:

Response response = db.save(myDocWithNoAttachments);
response = db.saveAttachment(att1InputStream, "myPic.jpeg", "image/jpeg", response.getId(), response.getRev());
response = db.saveAttachment(att2InputStream, "myOtherPic.jpeg", "image/jpeg", response.getId(), response.getRev());
// etc

If you want to discuss the actual plan limits further I suggest contacting Bluemix or Cloudant support as it is out of scope of the java-cloudant client.

@ricellis
Copy link
Member

Closing as answered, please re-open or open a new issue if there are additional questions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants