This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 19649
    
  18

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:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpClient just wont download a audio file
 
Similar Threads
Sending a jason object via Post
upload file through applet
Post an XML filt to a Web Server
HttpClient 4 and SOAP
Cannot download the whole text file