Results 1 to 4 of 4

Thread: inet: internet transfer control

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    La Place, LA USA
    Posts
    3

    Post

    When I retrieve a file using any method including

    objFTP.Execute <site>, "Get <file> c:\<file>"

    I always get a file that doesn't seem to be an ascii file. I know this because when I read this file the using Visual Basic's Statement Line Input I get the entire file instead of just one line. If I FTP the file using DOS the it works correctly.

    Any input would be appreciated.

    Thanks, JDF

  2. #2
    Guest

    Post

    http://support.microsoft.com/support.../Q188/9/56.ASP

    PRB: ITC Cannot Perform ASCII-type FTP Transfer

    --------------------------------------------------------------------------------
    The information in this article applies to:

    Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 5.0

    --------------------------------------------------------------------------------


    SYMPTOMS
    When you use the Microsoft Internet Transfer Control (ITC) to transfer text files to or from certain servers, the resulting file appears corrupted. It might appear to have extra or missing characters, or consist of completely meaningless garbage data.

    CAUSE
    The Microsoft Internet Transfer Control does not offer the option of an ASCII-type FTP file transfer. This can make it impossible to transfer text files to or from certain servers using this control.

    RESOLUTION
    Because the control does not offer this functionality, it cannot be used in situations where an ASCII-type transfer is required. One possible workaround is to call the Win32 Internet (WinInet) FTP APIs directly. These APIs are used by the ITC, and offer the option of either a binary or ASCII transfer, even though an ASCII-type transfer option is not exposed in the ITC.

    For an example of how to call the WinInet FTP APIs directly from Visual Basic, see the following article(s) in the Microsoft Knowledge Base:


    Q175179 : FILE: VBFTP.EXE: Implementing FTP Using WinInet API from VB

    STATUS
    This behavior is by design. The Internet Transfer Control is not a complete implementation of the FTP protocol.

    MORE INFORMATION
    The FTP protocol offers two types of transfers: binary and ASCII. In a binary download (which is always used by the ITC), the FTP server sends to the client the exact contents of a file. In a binary upload, the FTP server stores exactly what the client sends. This is desirable behavior for most types of files, such as executable programs, images, word processor documents, and so on.

    In contrast, during an ASCII transfer, the FTP server converts between standard ASCII (which is being sent to or received from the client), and the internal representation of text used on the server. The differences may be conventions for marking the end of a line with carriage-return and linefeed characters, or the server may use an entirely different text encoding method (usually EBCDIC, commonly used on IBM mainframe and midrange systems). If a server stores text files in a format other than standard ASCII, transferring it with the binary transfer type results in what appears to be "corrupt" data in the destination file, since the character set translation does not take place.

    Additional query words: kbVBp500 kbDSupport kbdsi

    Keywords :
    Version : WINDOWS:5.0
    Platform : WINDOWS
    Issue type : kbprb

    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl




  3. #3
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173

    Post

    Hi,
    If you check out the link at the end of the following article: http://www.vbsquare.com/internet/inet3/ then you will have a compelete class module that allows you to do FTP from the WinInet DLL.

    ------------------
    "To the glory of God!"


  4. #4
    Lively Member
    Join Date
    Jan 2000
    Posts
    65

    Post

    I agree that ftp control is not the best suited for your application.. I had similar
    problem while doing a PUT using internet transfer control.. Instead, use
    wininet.dll .. You have to specify the
    ASCII CONSTANT FTP_TRANSFER_TYPE_ASCII
    while using the DLL calls
    good luck

    sarath

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width