From: R.Wieser on
Hello All,

I'm currently diving into the InternetOpenUrl command and was wondering if
I could

1) ask it the protocol (HTTP, FTP, GOPHER) it has just accepted (so I can
use the apropriate commands to each protocol (for instance : not trying to
retrieve HTTP headers on a non-HTTP connection)

2) Retrieve the file-size when the protocol is not HTTP (I tried FTP, but
would like to be able to do the same for the other protocols). I've tried
the HTTP_QUERY_CONTENT_LENGTH method as well as FtpGetFileSize, but both
return an error.

Regards,
Rudy Wieser



From: Dee Earley on
On 20/12/2009 19:58, R.Wieser wrote:
> Hello All,
>
> I'm currently diving into the InternetOpenUrl command and was wondering if
> I could
>
> 1) ask it the protocol (HTTP, FTP, GOPHER) it has just accepted (so I can
> use the apropriate commands to each protocol (for instance : not trying to
> retrieve HTTP headers on a non-HTTP connection)

You can use InternetCrackURL to get the scheme of the URL you just
passed in.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems
From: R.Wieser on
Hello Dee,

> You can use InternetCrackURL to get the scheme of the
> URL you just passed in.

I know, its what I have done previously. I can even simplify that by doing
just text-compare with "HTTP://", "FTP://" or "GOPHER://".

But that means I would be attempting to mimic a test in another command,
something that is quite hard to when you have no information about how that
other test actually works (which input it accepts : are those three the
*only* things I have to check for ?).

Thats why I was looking for a way to let the command itself tell me its
test-result/accepted protocol. I can assume that when a HTTP-headers
related command fails the returned data is non-HTTP, but that is than not
even certain either ...

Regards,
Rudy Wieser


-- Origional message:
Dee Earley <dee.earley(a)icode.co.uk> schreef in berichtnieuws
4b2f452e$0$348$7b0f0fd3(a)reader.news.newnet.co.uk...
> On 20/12/2009 19:58, R.Wieser wrote:
> > Hello All,
> >
> > I'm currently diving into the InternetOpenUrl command and was
wondering if
> > I could
> >
> > 1) ask it the protocol (HTTP, FTP, GOPHER) it has just accepted (so I
can
> > use the apropriate commands to each protocol (for instance : not trying
to
> > retrieve HTTP headers on a non-HTTP connection)
>
> You can use InternetCrackURL to get the scheme of the URL you just
> passed in.
>
> --
> Dee Earley (dee.earley(a)icode.co.uk)
> i-Catcher Development Team
>
> iCode Systems