Discussion:
FTP Error information
(too old to reply)
Adrian ~ FoobarSoftware.com
2005-10-26 13:28:05 UTC
Permalink
I am using WinInet to make an FTP Connection (using
CInternetSession::GetFtpConnection ).

With some ISPs, extra text is passed back in error messages. For example, if
you try to connect to an account with tiscali.co.uk from a dialup account
other than the one they supply, you get a 530 response with some text like
this:

"Your upload to your personal webspace has not been successful. This is
because you have attempted to upload from a non-Tiscali connection. Please
try again using a Tiscali group dialup or broadband connection (including
LineOne, WorldOnline. Tiny, Gateway and Screaming.net). "


Since this sort of information is useful to the user when he/she is sorting
out connection problems, I want to be able to retrieve it and display it.
However, it does not appear in the text produced by the CInternetException
which is thrown, so is there a way for me to get at this text?

Many thanks for any help,

Adrian
Brian Cryer
2005-10-31 13:19:37 UTC
Permalink
"Adrian ~ FoobarSoftware.com"
Post by Adrian ~ FoobarSoftware.com
I am using WinInet to make an FTP Connection (using
CInternetSession::GetFtpConnection ).
With some ISPs, extra text is passed back in error messages. For example, if
you try to connect to an account with tiscali.co.uk from a dialup account
other than the one they supply, you get a 530 response with some text like
"Your upload to your personal webspace has not been successful. This is
because you have attempted to upload from a non-Tiscali connection. Please
try again using a Tiscali group dialup or broadband connection (including
LineOne, WorldOnline. Tiny, Gateway and Screaming.net). "
Since this sort of information is useful to the user when he/she is sorting
out connection problems, I want to be able to retrieve it and display it.
However, it does not appear in the text produced by the CInternetException
which is thrown, so is there a way for me to get at this text?
Many thanks for any help,
Adrian
I've encountered the same problem - that of wanting the extra information
that the FTP server returns when the connection fails.

Unfortunately I've not been able to find a way of getting this information
out from WinInet. I don't think you can do it.

The work around that I adopted was when the connection failed to open a the
ftp port directly (not using WinInet) send the username and password and
then read back the response. It sounds clunky, but seems to work reasonably
well.

Hope this helps.
--
Brian Cryer
www.cryer.co.uk/brian
Adrian ~ FoobarSoftware.com
2005-10-31 19:50:23 UTC
Permalink
Brian,

Thanks for the response.

Someone else pointed me towards the InternetGetLastResponseInfo function,
which seems to do exactly what I want - you get the full text supplied by the
FTP server, including the response codes.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/wininet_functions.asp

Hope this sorts out your issue too.

Cheers
Adrian
Post by Brian Cryer
"Adrian ~ FoobarSoftware.com"
Post by Adrian ~ FoobarSoftware.com
I am using WinInet to make an FTP Connection (using
CInternetSession::GetFtpConnection ).
With some ISPs, extra text is passed back in error messages. For example, if
you try to connect to an account with tiscali.co.uk from a dialup account
other than the one they supply, you get a 530 response with some text like
"Your upload to your personal webspace has not been successful. This is
because you have attempted to upload from a non-Tiscali connection. Please
try again using a Tiscali group dialup or broadband connection (including
LineOne, WorldOnline. Tiny, Gateway and Screaming.net). "
Since this sort of information is useful to the user when he/she is sorting
out connection problems, I want to be able to retrieve it and display it.
However, it does not appear in the text produced by the CInternetException
which is thrown, so is there a way for me to get at this text?
Many thanks for any help,
Adrian
I've encountered the same problem - that of wanting the extra information
that the FTP server returns when the connection fails.
Unfortunately I've not been able to find a way of getting this information
out from WinInet. I don't think you can do it.
The work around that I adopted was when the connection failed to open a the
ftp port directly (not using WinInet) send the username and password and
then read back the response. It sounds clunky, but seems to work reasonably
well.
Hope this helps.
--
Brian Cryer
www.cryer.co.uk/brian
Brian Cryer
2005-10-31 21:57:24 UTC
Permalink
I'll try InternetGetLastResponseInfo, but I'm sure that it didn't give me
the text - either that or I didn't try it - it wouldn't be the first time I
had the answer right under my nose and yet didn't see it. Thanks.
--
Brian Cryer
www.cryer.co.uk/brian


"Adrian ~ FoobarSoftware.com"
Post by Adrian ~ FoobarSoftware.com
Brian,
Thanks for the response.
Someone else pointed me towards the InternetGetLastResponseInfo function,
which seems to do exactly what I want - you get the full text supplied by the
FTP server, including the response codes.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/wininet_functions.asp
Post by Adrian ~ FoobarSoftware.com
Hope this sorts out your issue too.
Cheers
Adrian
Brian Cryer
2005-11-01 13:53:18 UTC
Permalink
With the FTP server that I'm testing against, I don't get back from
InternetGetLastResponseInfo the reason for the connection failure. I'm
assuming that whether or not it gives the relevant information may depend on
the FTP server that is being connected to - responses aren't as standard as
you might hope for.

If it works for you and you are unlikely to change FTP servers then run with
it.
--
Brian Cryer
www.cryer.co.uk/brian
Post by Brian Cryer
I'll try InternetGetLastResponseInfo, but I'm sure that it didn't give me
the text - either that or I didn't try it - it wouldn't be the first time I
had the answer right under my nose and yet didn't see it. Thanks.
--
Brian Cryer
www.cryer.co.uk/brian
"Adrian ~ FoobarSoftware.com"
Post by Adrian ~ FoobarSoftware.com
Brian,
Thanks for the response.
Someone else pointed me towards the InternetGetLastResponseInfo function,
which seems to do exactly what I want - you get the full text supplied by
the
Post by Adrian ~ FoobarSoftware.com
FTP server, including the response codes.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/wininet_functions.asp
Post by Adrian ~ FoobarSoftware.com
Hope this sorts out your issue too.
Cheers
Adrian
Continue reading on narkive:
Loading...