I am trying to using Mobile SDK to upload file and I'm logged in too (other services I tested are working fine),
Now I am trying to upload files (specifically images in my case) as described here:

FileRequests.uploadFile(myFile, myFile.name, "Test Title", "Test Description", "image/jpeg")

where myFile is an image in the storage with file path as something like this (I have the runtime dangerous storage permissions for android too):


And then calling the sendAsync() method as below :

client.sendAsync(request, object : RestClient.AsyncRequestCallback {
            override fun onSuccess(request: RestRequest, result: RestResponse) {
                result.consumeQuietly() // consume before going back to main thread
                try {
                } catch (e: java.lang.Exception) {

            override fun onError(exception: Exception) {

and the response I am getting in onSuccess() is

[{"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}]

I am not sure where I am going wrong! Any help is appreciated :)

P.S I already checked for file and it exists fine and is accessible too(set it in an ImageView and it works fine) also the header I checked is :

  "method": "POST",
  "url": "\/services\/data\/v46.0\/chatter\/connect\/files\/users\/me",
  "httpHeaders": {"X-Chatter-Entity-Encoding": "false"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.