I've been trying to figure this out since monday, searching through bunches of google groups and what not.. without finding answers. See if you guys have any idea of what's causing this to fail so miserably.
I am trying to programmatically download a file from a website. The way it works manually is as follows:
1. User clicks on a 'Download' button
2. HTTP GET is sent to the server: http://yyy.com/send-file.cgi?action=Download&filename=myfile.000
3. In response a dialog box pops up, user is prompted to choose path and save the file
4. User clicks save, and file is downloaded
The dialog box pops up because the server's response header has Content-Disposition set to attachment. This way the file is not stored in the message body, but in the attachment. Here are the server's response headers:
Content-Disposition: attachment; filename=myfile.000
Commons' HttpClient, provides methods to read the message body, headers and footers, however I could not figure out whether the attachment is stored in either of the three, or whether I need to look for another API (suggestions welcomed!) to get that file in from an application.
Thanks ahead for any ideas/direction,