This week's book giveaway is in the Java in General forum. We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line! See this thread for details.
I'm trying to download a file. I don't know what the filename is because the URL hits a CGI script. How do I get the filename from before it downloads? A browser is able to, so I think it's in the header. I've tried to get the "content-disposition" field from the URLconnection, however it is null. Thanks, Justin Here is some of the code: readMe = new URL("http://mysite.com/runthis.php?rid=" + i); URLConnection rc = readMe.openConnection(); System.out.println("filename: " + rc.getHeaderField("Content-Disposition"));