Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: check if a file accessible on a web server
| Subject: | Re: check if a file accessible on a web server |
| Posted by: | "York" (offi..@onlinebg.info) |
| Date: | Tue, 27 Jun 2006 12:09:51 |
Thanks Francois,
What I am actually trying to accomplish is to check if a specific file of
type ".exe" or ".zip" is located
on the server. So I think this is going to work in this case, right?
Thanks for the quick response.
"Francois Piette [ICS & Midware]" <francois.piette@overbyte.be> wrote in
message news:44a0f2f9@newsgroups.borland.com...
> The HEAD command will work with all static documents. But with some
servers
> and dynamic documents, it doesn't work.
>
> --
> francois.piette@overbyte.be
> Author of ICS (Internet Component Suite, freeware)
> Author of MidWare (Multi-tier framework, freeware)
> http://www.overbyte.be
>
> "York" <office@onlinebg.info> a écrit dans le message de
> news:44a0f068@newsgroups.borland.com...
> > hello
> >
> > I wonder if this is a good way to check if a file is accessible on a web
> > server without getting it.
> >
> > function Web_FileExists(AURL: String): Boolean;
> > var idHttp: TIdHTTP;
> > begin
> > Result := False;
> > idHTTP := TIdHTTP.Create(nil);
> > try
> > idHttp.Head(AURL);
> > Result := idHttp.ResponseCode = 200;
> > finally
> > idHTTP.Free;
> > end;
> > end;
> >
> > Thanks in advance.