我有一个类似的错误,因为我使用了CountingInputStreamEntity这是一个不可重复的http客户端。解决方案是使用BufferedHttpEntity,它将不可重复的HTTP客户端转换为可重复的httpclient。
ParcelFileDescriptor fileDescriptor = this.getContentResolver().openFileDescriptor(uri, "r"); InputStream in = this.getContentResolver().openInputStream(uri); CountingInputStreamEntity entity = new CountingInputStreamEntity(in, fileDescriptor.getStatSize()); entity.setUploadListener(this); entity.setContentType("binary/octet-stream"); entity.setChunked(true); BufferedHttpEntity myEntity = null; try { myEntity = new BufferedHttpEntity(entity); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } put.setEntity(myEntity);


