Is it possible to get the name of a file downloaded with HttpURLConnection?
URL url = new URL(\"http://somesite/getFile?id=12345\");
HttpURLConnection conn =
The frank answer is - unless the web server returns the filename in the Content-Disposition header, there isn't a real filename. Maybe you could set it to the URI's last portion after the /, and before the query string.
Map m =conn.getHeaderFields();
if(m.get("Content-Disposition")!= null) {
//do stuff
}