Discussion:
TYPE on FtpGetFile
(too old to reply)
Stefano "WildHeart" Lanzavecchia
2004-12-24 12:18:26 UTC
Permalink
Is it possible to prevent FtpGetFile to send a "TYPE" command when doing an
FtpGetFile?
A customer of mine has got a strange FTP servers which accepts the "ASCII"
and "BINARY" commands but chokes on "TYPE A" and "TYPE I".

Thanks in advance and Merry Christmas to everybody!
--
WildHeart'2k4
Brian Combs
2004-12-28 20:55:45 UTC
Permalink
Hello
There is no way to change this with WinInet. Also this is correct. RFC for
FTP states the following:

http://www.ietf.org/rfc/rfc959.txt

REPRESENTATION TYPE (TYPE)

The argument specifies the representation type as described
in the Section on Data Representation and Storage. Several
types take a second parameter. The first parameter is
denoted by a single Telnet character, as is the second
Format parameter for ASCII and EBCDIC; the second parameter
for local byte is a decimal integer to indicate Bytesize.
The parameters are separated by a <SP> (Space, ASCII code
32).

The following codes are assigned for type:

\ /
A - ASCII | | N - Non-print
|-><-| T - Telnet format effectors
E - EBCDIC| | C - Carriage Control (ASA)
/ \
I - Image

L <byte size> - Local byte Byte size

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Stefano \"WildHeart\" Lanzavecchia" <stf+***@apl.it>
| Subject: TYPE on FtpGetFile
| Date: Fri, 24 Dec 2004 13:18:26 +0100
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <***@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| NNTP-Posting-Host: 194.185.164.88
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl
microsoft.public.inetsdk.programming.wininet:11935
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Is it possible to prevent FtpGetFile to send a "TYPE" command when doing
an
| FtpGetFile?
| A customer of mine has got a strange FTP servers which accepts the
"ASCII"
| and "BINARY" commands but chokes on "TYPE A" and "TYPE I".
|
| Thanks in advance and Merry Christmas to everybody!
| --
| WildHeart'2k4
|
|
|
Stefano "WildHeart" Lanzavecchia
2004-12-29 08:37:35 UTC
Permalink
Post by Brian Combs
Hello
There is no way to change this with WinInet. Also this is correct. RFC for
Thank you for your kind reply. A bit more analysis (very difficult to do
without the logs of the server!) showed that the problem was in the PASV
flag. I got it from an article where it was misquoted to be "0x80000000"
instead of "0x08000000". So the server was choking on the PORT command and
not the "TYPE A". Reading the official documentation from the MSDN showed me
the mistake. Second, it turned out that the Windows2000 ftp "dos" prompt
client doesn't like "type a" but insists on "ascii" to be the only way to
change the mode (while it probably sends a TYPE A behind the covers). And
that got me stumped for a while, though I should have noticed that the error
message didn't include a standard FTP return code. Now everything is fine.

All the best,
--
WildHeart'2k4
Paul Baker
2004-12-29 14:25:24 UTC
Permalink
Stefano,

Actually, the FTP command line has its own commands and rather kindly sends
FTP commands and interprets the results for you, including opening any ports
necessary - while still allowing you to send literal FTP commands. In this
case, you would use "LITERAL TYPE A".

Paul
Post by Stefano "WildHeart" Lanzavecchia
Post by Brian Combs
Hello
There is no way to change this with WinInet. Also this is correct. RFC for
Thank you for your kind reply. A bit more analysis (very difficult to do
without the logs of the server!) showed that the problem was in the PASV
flag. I got it from an article where it was misquoted to be "0x80000000"
instead of "0x08000000". So the server was choking on the PORT command and
not the "TYPE A". Reading the official documentation from the MSDN showed me
the mistake. Second, it turned out that the Windows2000 ftp "dos" prompt
client doesn't like "type a" but insists on "ascii" to be the only way to
change the mode (while it probably sends a TYPE A behind the covers). And
that got me stumped for a while, though I should have noticed that the error
message didn't include a standard FTP return code. Now everything is fine.
All the best,
--
WildHeart'2k4
Loading...