Volley-demo icon indicating copy to clipboard operation
Volley-demo copied to clipboard

MultiPartRequest bug

Open com314159 opened this issue 11 years ago • 2 comments

MultiPartRequest can't upload file, I think the bug is in SslHttpStack, setMultiPartBody(postRequest,request); //setEntity setEntityIfNonEmptyBody(postRequest, request); //setEntity

you have set httpRequest.setEntity(entity) twice, so the MuliPartBody entity is override by getBody entity.

com314159 avatar Oct 07 '14 03:10 com314159

@com314159 There is a MultiPartRequestActivity class in your code?

annelorayne avatar Oct 17 '14 14:10 annelorayne

@annelorayne no.

I have write a demo project, it now can upload file. you can clone it. https://github.com/com314159/VolleyMultiPartRequest

the core code is in MultiPartStack.java

If it can't upload file large than 10M, you should set connection timeout longer or use the default timeout.

com314159 avatar Oct 22 '14 03:10 com314159