Search code examples
androidquickblox

Method Not Allowed (405) while uploadFileTask to QuickBlox - (Android)


My problem is I am using QBContent.uploadFileTask(file, true, null, new QBEntityCallback() to upload the file to QuickBlox. But I am landing on onError(List list). Check pictures please.

  1. This is I get in OnError Method: enter image description here
  2. Showing in Logcat: enter image description here

    Here is my Code:

    protected void startLoadAttachAudio(final File file) { Handler h = new Handler(Looper.getMainLooper()); h.post(new Runnable() { public void run() {

            QBContent.uploadFileTask(file, true, null, new QBEntityCallback<QBFile>() {
                @Override
                public void onSuccess(QBFile qbFile, Bundle bundle) {
                    System.out.println("Success");
                }
    
                @Override
                public void onSuccess() {
                    System.out.println("Success2");
                }
    
                @Override
                public void onError(List<String> list) {
                    System.out.println("Failed.");
    
                }
            });
        }//end of run
    }); //end of handler
    

    }


Solution

  • I solved it myself by Updating the SDK version of Quickblox