Support Topics Documentation Slack YouTube Blog

Upload files bitmap not available

(SnakeEyes) #1


Is the upload of Bitmap using the Files service no longer available? The call is unrecognized and it only shows the upload of File or OutputStream

(Anton Govorushkin) #2

Hi @snakeeyes

Please show the code which is failing and the error you get (if there is such)


(SnakeEyes) #3

Bitmap bt = ((BitmapDrawable)ivMyPicture.getDrawable()).getBitmap();
Backendless.Files.upload(bt,CompressFormat.JPEG, 100, “pic.jpg”, “/user123”, AsyncCallback<BackendlessFile>() {
public void handleResponse(BackendlessFile response) {

public void handleFault(BackendlessFault fault) {

(Anton Govorushkin) #4

Hi @snakeeyes

I believe something is wrong either with the picture entity or somewhere else in your code, as I tried uploading pictures using bitmap approach. Used same method with the same number of arguments and everything works fine. Still didn’t receive any info regarding the error you are getting. Does the code go into the handleFault block? If so what does the error message say?

BTW you may want to download Android File uploading sample in Codegeneration tab of your Backendless app to verify that uploading API works as expected and to see how it’s implemented


(SnakeEyes) #5

Hi @Anton,
The error is that the upload method with bitmap is not recognized by the SDK.
Only the 8 upload methods from File and the 2 upload methods from Stream are available to be invoked from the SDK

I am using backendless version 5.0.2

(Vladimir Yalovy) #6

Hi @SnakeEyes

You use SDK for Android/Java? -> Android Only
Your bitmap -

(Anton Govorushkin) #7

That’s weird. I tried the same method as you did both with latest SDK (5.2.2) and with 5.0.2. In both cases method is recognized successfully. The signature is as following:

public BackendlessFile Backendless.Files.upload( 
                               int quality,
                               String remoteName,
                               String remotePath, AsyncCallback<BackendlessFile>() )

I’d recommend to try the following:

  1. Make sure you are passing as a first argument
  2. Upgrade Backendless SDK to latest
  3. If 1 - true, try cleaning your gradle (rm -rf ~/.gradle/caches in your termianl) and Android project cache


(SnakeEyes) #8

I upgraded to the new release. It is still not there. Infact I went to your githib

and you can see that no method accept Bitmap in there

(Oleg Vyalyh) #9

These methods now placed in class com.backendless.FilesAndroidExtra.
Use it, please, in such way: Backendless.Files.Android.upload().