Skip to main content

Problem:

There is no FTP routine in Cobol to access and interact with a FTP server. This however can be done by using the Windows Internet (WinINet) application programming interface (API).

Resolution:

BUILD W/RELEASE:     Net Express v5.x

============

INTRODUCTION

==========

The attached demo uses the Windows Internet (WinINet) application programming interface (API) to interact with FTP protocols to access Internet resources. It is using WinInet functions to accomplish the following tasks:

    1. open Internet session (InternetOpen)

    2. log on to FTP server (InternetConnect)

    3. determine current directory (FtpGetCurrentDirectory)

    4. change directory (FtpSetCurrentDirectory)

    5. create new directory (FtpCreateDirectory)

    6. upload file (FtpPutFile)

    7. rename file (FtpRenameFile)

    8. download file (FtpGetFile)

    9. delete file (FtpDeleteFile)

   10. delete directory (FtpRemoveDirectory)

   11. end Internet handle (InternetCloseHandle)    

The purpose of the demo is more focused on how to use use WinInet functions rather than efficiency.   It does not determine the cause of any errors. It simply sees if the function succeeded or not.

SOURCE FILES:

=========

Program Files     Description

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

FTPprogram.cbl       Example program that uses the functions listed above

REQUIREMENTS:

===========

The Ftp project uses procedure-pointer items and COBOL set statements to load the required Dll (Wininet.dll).

OPERATION:

========

Both projects can be Animated.

==========================================================

Keywords: demonstration, sample, example, demo, win32 api, ftp, ftpprogram.zip

demo.ex

demo.ne

Attachments:

FTPprogram.zip

Attachments

Old KB# 1346