Also in Blob class, getContent() method which should return the byte array is always returning null. getContentStream() is working fine. For JPG images, I was getting an error while converting it to Bitmap using BitmapFactory.
It would be helpful to show what you have done to see if anything is out of place. The documentation there is slightly out of date as it struggles to keep up with the ever changing DB API.
The image you shared works for me with the code snippet I shared earlier .
Looked at your gist and except for the fact that its in Kotlin (Yay :-)) , it seems more or less what I have.
I noticed both these lines uncommented though. Can you double check that you had the appropriate line commented out when you used jpeg and png
Hello @priya.rajagopal , I also have a blob data I am trying to work with. I can actually use getBlob to get the data from server, but if I try to use getContent from the blob, it returns back a null value.
Please, can you tell me where I am getting it all wrong?
Dictionary data = result.getDictionary(1);
** Log.e(“RESULTBLOB”, String.valueOf(data.getValue(“imageFile”)));** Log.e(“RESULTBLOBCONTENT”, String.valueOf(data.getBlob(“imageFile”).getContent()));
I actually get the expected data on the RESULTBLOB but RESULTBLOBCONTENT actually returns a null value even if I try to user getBlob, I still get a null value.
Moreover, is there a way i can convert my data.getValue to a blob data?