Re: Using TidHTTP to determine if file exists?

Giganews Newsgroups
Subject: Re: Using TidHTTP to determine if file exists?
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Wed, 19 Oct 2005

"Jesse" <nospam@fake.com> wrote in message
news:6D09ABAC8DDEE240nospam@fake.com...

> I want to use TidHTTP to download a file from our web site.
> However, I want to make sure the file exists first.

You can use TIdHTTP.Head() for that.  Head() returns just the headers for
the resource.

> I'm using an asp page to create an export file, so initially, the
> file may not exist until it's created, and I don't want to initiate
> the download until it's there.

Are you accessing the ASP page when downloading the file, or are you calling
the ASP page and then downloading the file directly in a separate request?
If the ASP page is sending the file at the same time that it is created,
then there is no need to check if the file exists beforehand.

Alternatively, since you are writing your own ASP code anyway, you could
just make a separate ASP page that reports whether the file exists or not.

Gambit

Replies

In response to

Using TidHTTP to determine if file exists? posted by Jesse on Wed, 19 Oct 2005