W3C home > Mailing lists > Public > www-jigsaw@w3.org > November to December 2000

Cookie Problem while downloading a file

From: Edison Aspert <aspertedison@yahoo.com>
Date: Mon, 18 Dec 2000 15:47:18 -0800 (PST)
Message-ID: <20001218234718.5567.qmail@web3903.mail.yahoo.com>
To: www-jigsaw@w3.org
Hi,

I am trying to download a file from www.cel.com.

Here is the code


HttpManager manager = HttpManager.getManager() ;
CookieFilter cflt = new CookieFilter();
cflt.initialize(manager);
Request request = manager.createRequest() ;
request.setMethod("GET") ;
request.setURL(new URL("http://www.cel.com/"));
Reply reply = manager.runRequest(request) ;
while(reply.getStatus() == 302)
{
System.out.println("Reply Header Descriptions:");
Enumeration e = reply.enumerateHeaderDescriptions();
while(e.hasMoreElements())
{
System.out.println(((HeaderDescription)
e.nextElement())).getName());
}
String redirectURL = reply.getLocation();
System.out.println("Redirect "+redirectURL);
StringBuffer buf = new
StringBuffer("http://www.cel.com");
buf.append(redirectURL);
redirectURL = buf.toString();
System.out.println("Redirect URL "+redirectURL);
request.setUserAgent("Mozilla/4.0 (compatible; MSIE
4.01; Windows 95)");
request = manager.createRequest();
request.setURL(new URL(redirectURL));
//cflt.initialize(manager);
reply = manager.runRequest(request);
}
InputStream in = reply.getInputStream() ;
BufferedReader bufferedReader = new BufferedReader(new
InputStreamReader(in));
String inputLine;
while ((inputLine = bufferedReader.readLine()) !=
null)
{
System.out.println(inputLine);
}

I am getting a error page saying that my application
does not support cookies.

Aspert Edison

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/
Received on Monday, 18 December 2000 18:47:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT