Home > Back-end >  Image Not uploading in base64 format using retrofit
Image Not uploading in base64 format using retrofit

Time:09-12

I Am uploading an image which I convert into base64 , and try to send image into server, using Retrofit Library, but problem is that, Sometime Image Are Uploading successfully but sometime its going on on Failure() method in Retrofit , and throwing the error is timeout , I don't know what is the problem with that , sometime its working or sometime its not working, I am also trying to increase the time using http but still having the Same problem.

CodePudding user response:

The description you gave is a little bit vague. Could you share more info? What type of file are you trying to upload? The size of the files that are failing vs the ones that are succeeding the upload. Mind that if you base64 encode the contents of an mage it ends up being about 33% bigger and server might be closing connections that last longer than say 5 seconds ending up in timeouts. Please share some logs and stack-traces alongisde the metadata of the files you're uploading :) Probably you can fix this problem server-side by extending the TTL before a timeout's thrown

CodePudding user response:

Try to use OKHttp, it's more robust, here a link that can help you: OKHttp

  • Related