Download file using android-async-loopj
I am using this code:
/* This is an asynchronusHTTP client*/
AsyncHttpClient client = new AsyncHttpClient();
client.get(url, params,new FileAsyncHttpResponseHandler(file) {
@Override
public void onSuccess(int statusCode, Header[] headers, File response) {
// Do something with the file `response`
}
});
but i got an empty file. The documentation says success, it writes the result to the passed file, but it doesn't.
+3
source to share
1 answer
What you are saying is called URL encoding, which will not throw an invalid character error as far as I know. If you think there is a url encoding problem, try adding this line to your get (String url parameter, RequestParams, FileAsyncHttpResponseHandler responseHandler)).
client.setURLEncodingEnabled(false);
0
source to share