Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : check if a file accessible on a web server
| Subject: | check if a file accessible on a web server |
| Posted by: | "York" (offi..@onlinebg.info) |
| Date: | Tue, 27 Jun 2006 11:46:31 |
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.