Re: WebClient - detect response redirect
From: Adam Clauss (cabadam_at_nospam.tamu.edu)
Date: 01/12/05
- Next message: Ranjan: "EBCDIC to ASCII"
- Previous message: Jeff Louie: "Re: Convert C# command prompt app to Windows App"
- In reply to: Glen: "WebClient - detect response redirect"
- Next in thread: Glen: "Re: WebClient - detect response redirect"
- Reply: Glen: "Re: WebClient - detect response redirect"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 11 Jan 2005 23:39:32 -0600
I don't think there is a way using the WebClient class.
If you are using HttpWebRequest, there is the AllowAutoRedirect property
which may allow you to accomplish what you need.
-- Adam Clauss cabadam@tamu.edu "Glen" <BuGlen@hotmail.com> wrote in message news:u4HTxXF%23EHA.3756@TK2MSFTNGP14.phx.gbl... > I'm writing a console utility to download specific files from web sites > based on the command line options. In most cases, I can trap the 404 > error when the file isn't available because the operator mistyped the URL > or it's offline for whatever reason. The problem I'm running into is with > certain sites where the admin has set up a redirect to handle the 404 > condition and redirects the request to another page. > > In this case, the redirected page gets downloaded and saved which is not > the desired result. This utility is being used in a scheduling process to > download and process specific data files from public web sites and the > files must exist, or return an error to halt processing. > > Is there anyway to tell the WebClient or WebRequest objects to not allow > redirected content? Or, is there a property in either of the objects that > reflects the actual URL of the source when it's redirected? Or, is there > an alternative object that can be used for this purpose to download files > from web sites? > > Any help would be greatly appreciated. > > - Glen
- Next message: Ranjan: "EBCDIC to ASCII"
- Previous message: Jeff Louie: "Re: Convert C# command prompt app to Windows App"
- In reply to: Glen: "WebClient - detect response redirect"
- Next in thread: Glen: "Re: WebClient - detect response redirect"
- Reply: Glen: "Re: WebClient - detect response redirect"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|