cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Body, Checking scripts???

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 3 Mar 2001 18:44:50 +0100 (MET)

On Sat, 3 Mar 2001 pit_at_paradise.net.nz wrote:

> Now i want to put some more control on it.
>
> Like authenticating and locating files before the actions.

Well, authenticating is not much to add. Just send some more options to
libcurl.

> I can't think of a good way (lack of experience...^^) to return the
> output of checking.

I'm guessing here that you're talking about using HTTP to verify that the
requested file is present?

In that case, make sure that the return code specified in the reply-headers
is 200 when you make a HEAD on the file. There are several ways to check
that, but curl_getinfo() is certainly an easy way.

> Especially when downloading files. Where the body part is binary ( ie.
> body=fopen(filename, "wb") ). How can i pull out the text bits that might
> be returned from CGI/PHP script?

You write the body part to the file, you need to check that file for whatever
it is you want to find.

> Do i need seperate scripts for checking and downloading?

It is impossible for me to say based on this absense of information, but I
would say that in general that is a good idea.

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-03-03