On Wed, 8 Mar 2000, Jacqueline Landman Gay wrote:

> I'm still working with the "load url" commands. If I ask for a known
> bogus file on the server, it still appears to load properly, and the
> cachedURLs function contains the url of the non-existent bogus file. The
> urlStatus reports it is "cached". I have a repeat loop checking for an
> error, timeout, or "not found" status, but none of these ever trigger.
> How do I tell if the requested download is bogus? And why is its status
> "cached" when it never downloaded?

Unfortunately you actually have to look at the bits and see if you
recognize anything.  Fortunately most files have some sort of header
that you can look for.  It should also be possible to detect an HTTP
error in the returned HTML (like a 404 error code), but I suspect that
this would be harder than ensuring you *are* getting what you're
looking for.

> Alternately, is it possible to check for the existence of a file on a
> remote server without downloading it, something like: "there is a url
> <myURL>" or "there is a file <myURL>"? That's all I'm really trying to
> do here.

There is a "head" command in the HTTP spec that's designed to do just
this.  But even if it were implemented it still wouldn't solve your
problem because you still have to know what you're looking for to
distinguish it from the wide variety of error messages you can get
from the various HTTP servers.

> Finally, suppose I do get a valid file from the server and it's a text
> file. How do I access the content of the cached url in order to, say,
> put the text into a field?

You just refer to it like a normal URL:
put url "http://whatever was cached" into field 1

It just loads it out of the cache if it's already been downloaded.

> It sure would help if someone would document this stuff.

It maybe a bit terse for your tastes, but this exact behavior is
documented on the "load" command page in the Reference.  What you may
be lacking is an understanding of the HTTP protocol, which
unfortunately you really have to have if you're going to do much work
in this area.
  Regards,
    Scott

> -- 
> Jacqueline Landman Gay        |             [EMAIL PROTECTED]
> HyperActive Software          |                   [EMAIL PROTECTED]
> Custom hypermedia solutions   |         http://www.hyperactivesw.com
> 612.724.1596                  |                   612.724.1562 - fax
> 
> This is the MetaCard mailing list.
> Archives: http://www.mail-archive.com/metacard%40lists.best.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> 

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send any bug reports to <[EMAIL PROTECTED]>, not this

Reply via email to