Skip to content Skip to sidebar Skip to footer

Downloading File From Webview Returns Html Content Not The Actual File

I am using a downloadListener to download a file from a webview. The filename is correctly recognized, however the html content is downloaded. In case it is relevant, I am trying t

Solution 1:

Update: The solution is to add the cookie as well as the user-agent to the request property.

String cookie = CookieManager.getInstance().getCookie(url);
con.setRequestProperty("cookie",cookie);
con.setRequestProperty("User-Agent",userAgent);

Post a Comment for "Downloading File From Webview Returns Html Content Not The Actual File"