Im trying to upload an image to a document, here is my code to upload the
bitmap
if (bmp == null) {
Timber.e("Bitmap loading failed");
return;
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.JPEG, 75, outputStream);
InputStream inputStream = new ByteArrayInputStream(outputStream.
toByteArray());
Document doc = database.getDocument(currentUser.id);
UnsavedRevision newRev;
try {
newRev = doc.getCurrentRevision().createRevision();
newRev.setAttachment(
"profileImage",
"image/jpg",
inputStream);
newRev.save();
} catch (CouchbaseLiteException e) {
e.printStackTrace();
}
When i try to upload this image i get this error
Got error status: 403 for {url}/db/{uuid}?new_edits=false. Reason:
Forbidden
Doing the same thing but not calling set attachment with my bitmap allows
the doc to upload. Updating any of the properties of the new doc doesn't
return a 403, but if you add an attachment it gives a 403 and doesnt sync
with server but seems to update locally.
Im on android using couchbase-lite-android:1.0.3
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/3ab5b128-44b8-4f87-9785-165335a326d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.