aspose file tools*
The moose likes I/O and Streams and the fly likes HttpClient just wont download a audio file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "HttpClient just wont download a audio file" Watch "HttpClient just wont download a audio file" New topic
Author

HttpClient just wont download a audio file

olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
hi,

i have the following code:


but it wont download the file.
i retrieve a 302 Found from the server, but httpclient wont follow
when i test another website where i'm sure that there will be no 302 then it works
can someone please help me? :/
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

302 means that there is a temporary redirect. Check out the getFollowRedirects and setFollowRedirects of HttpMethod. It should be set to true.

For your information, HttpURLConnection and probably most other classes for connecting to web servers have similar methods.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
its a HttpPost, looks like there's no such method
olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
so as i heard its against some RFC or so... but FF, IE and so on can handle it
the overwritten code which works for me is:

 
Don't get me started about those stupid light bulbs.
 
subject: HttpClient just wont download a audio file