QuickBlox / quickblox-android-sdk

QuickBlox Android SDK includes code snippets with main use cases and framework JAR library.
BSD 3-Clause "New" or "Revised" License
417 stars 697 forks source link

'{"base":["record is too large (current: 568852, max: 131072)"]}' #761

Closed akhil-0181 closed 3 years ago

akhil-0181 commented 3 years ago

I have use custom object and create new object and add two field one for post_title and second one is post_image. post_image i have put base64 string.

but every time it's getting error like '{"base":["record is too large (current: 568852, max: 131072)"]}'

              QBCustomObject qbCustomObject = new QBCustomObject();
                qbCustomObject.setClassName("Userchat");
                qbCustomObject.setParentId(user_chat_id);
                qbCustomObject.setUserId(Integer.valueOf(Utils.getSavedData(ProductDetailActivity.this, Constants.USER_CHAT_ID)));
                qbCustomObject.putString("Post_Title", post_title);

                URL url2 = null;
                String imageName = "";
                String encodedImageData = "";
                try {
                    url2 = new URL(imageURL);
                    Bitmap image2 = BitmapFactory.decodeStream(url2.openConnection().getInputStream());
                    encodedImageData = getEncoded64ImageStringFromBitmap(image2);
                } catch (MalformedURLException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                    Log.e("File Exception", e.getMessage());
                }
                qbCustomObject.putString("Post_Image", encodedImageData);
                QBCustomObjects.createObject(qbCustomObject).performAsync(new QBEntityCallback<QBCustomObject>() {
                    @Override
                    public void onSuccess(QBCustomObject createdObject, Bundle params) {
                        // Object created successfully
                        Toast.makeText(ProductDetailActivity.this, "success", Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onError(QBResponseException errors) {
                        // Error occurred
                        Toast.makeText(ProductDetailActivity.this, errors.getMessage(), Toast.LENGTH_SHORT).show();

                    }
                });