Re: WebClient - detect response redirect
From: Glen (buglen_at_hotmail.com)
Date: 01/12/05
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: Custom Installation"
- Previous message: toufik: "Mondosearch error"
- In reply to: Adam Clauss: "Re: 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: Wed, 12 Jan 2005 09:28:23 -0500
Thanks Adam. I'll give that one a look.
- Glen
"Adam Clauss" <cabadam@nospam.tamu.edu> wrote in message
news:OMiMZkG%23EHA.2608@TK2MSFTNGP10.phx.gbl...
> 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: Ignacio Machin \( .NET/ C# MVP \): "Re: Custom Installation"
- Previous message: toufik: "Mondosearch error"
- In reply to: Adam Clauss: "Re: 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
|