Discussion:
Wininet FtpCommand
(too old to reply)
raykos
2004-10-26 12:41:18 UTC
Permalink
Hi all,

Felt like I was in a losing battle with the Wininet 'FtpCommand', just
couldn't
seem to get it to work like I thought it was supposed to. I could do the
'NLST',
but then it wouldn't work with 'SITE MAPIN TEXT....', when I went to do the
InternetReadFile it would just hang! But then I had a "DUH moment"! The
explanation for the 2nd parameter(expecting a response,True or False) was a
little misleading to me.
The 2nd param should only be TRUE if you are expecting data to be
returned on
the data channel(like the NLST), then you use "InternetReadFile"; else if
you're sending a control type command, i.e.'SITE ...', the parameter should
be FALSE and you can use 'InternetGetLastResponseInfo' to find out what
happened.
Don't know if I'm the only one that had this problem, but I thought I'd
pass it
on in case it could help...

Ray K.
Paul Baker [MVP, Windows - SDK]
2004-10-26 13:14:55 UTC
Permalink
Yes, that sounds right to me.

Paul
Post by raykos
Hi all,
Felt like I was in a losing battle with the Wininet 'FtpCommand', just
couldn't
seem to get it to work like I thought it was supposed to. I could do the
'NLST',
but then it wouldn't work with 'SITE MAPIN TEXT....', when I went to do the
InternetReadFile it would just hang! But then I had a "DUH moment"! The
explanation for the 2nd parameter(expecting a response,True or False) was a
little misleading to me.
The 2nd param should only be TRUE if you are expecting data to be
returned on
the data channel(like the NLST), then you use "InternetReadFile"; else if
you're sending a control type command, i.e.'SITE ...', the parameter should
be FALSE and you can use 'InternetGetLastResponseInfo' to find out what
happened.
Don't know if I'm the only one that had this problem, but I thought I'd
pass it
on in case it could help...
Ray K.
Loading...