It's less android question and more Parse.com question, but I need your help:
I have an image file in a table in my application at Parse.com
The file is ok, I can manually download it and watch it.
But when trying to get it using parseObject that I alreay get from server, I'm getting "null"
code:
byte[] imageFile = parseObject.getBytes(Statics.COL_IMAGE_FILE);
What am I doing wrong?
p.s. : I can see the image file data/link in the parseObject "estimatedData" field, but can't get him.
If Statics.COL_IMAGE_FILE is a File column, you should do the following to get byte[]:
ParseFile imageFile = (ParseFile)parseObject.get(Statics.COL_IMAGE_FILE);
imageFile.getDataInBackground(new GetDataCallback() {
public void done(byte[] data, ParseException e) {
if (e == null) {
// data has the bytes for the image
} else {
// something went wrong
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With