> I am using HTTPCli to load a file from a webserver, works properly.
> However, when I try to load a file which cannot be found on the server,
> HTTPCli treats the servers error message as if it were the file and does
> not report any error.
> The resulting file saved on disk is just the html code of the page you
> receive from a webserver when you try to access a file which isn't there.

That's the way HTTP protocol work. There is no "file" in HTTP, only
documents.

> Is there a way to catch this kind of error?

Depends on the server. Normally the server returns a status code such as
"404" which means document not found. You have access to this error code in
the StatusCode property. Look also at the "ReasonPhrase" property.

The problem is that some server (or server side script) do not return
correct error code and then you can't differenciate programmatically between
a good and a bad download. Only reading the returned document can tell you
it is failed or not.


Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to