簡體   English   中英

圖片未使用 retrofit 以 base64 格式上傳

[英]Image Not uploading in base64 format using retrofit

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是timeout ,我不知道這是什么問題,有時它工作或有時它不工作,我也試圖增加使用 http 的時間,但仍然有同樣的問題。

你給的描述有點模糊。 你能分享更多信息嗎? 您要上傳什么類型的文件? 上傳失敗的文件與上傳成功的文件的大小。 請注意,如果您 base64 對法師的內容進行編碼,它最終會大 33% 左右,並且服務器可能會關閉持續時間超過 5 秒的連接,最終導致超時。 請與您上傳的文件的元數據一起分享一些日志和堆棧跟蹤:) 可能您可以通過在引發超時之前擴展 TTL 來解決服務器端的這個問題

嘗試使用OKHttp,它更健壯,這里有一個鏈接可以幫助你: OKHttp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM