PHF Logo

PHF Consultancy


Development | Consultancy | Training

www Search this site
Powered by
Google
Home

Email

BookMark
Home Contact Us Products Services Technology How To... Partners Other Links

FTP (File Transfer Protocol) Client API (Product: DBLFTP Version 1.0)

 

Communicate directly with FTP servers from your Synergy application. Support most of the common functions for transferring binary and ascii files to and from an FTP server using passive mode.

The API supports the equivalent of the following FTP commands

  •  CWD   Change the current directory on the server
  •  LIST    List the contents of a directory
  •  TYPE   Set file type for transfer (Binary or ASCII)
  •  RETR  Requests the server to send a file
  •  STOR  Sends a file from the client to the server
  •  DELE  Removes a file from the server
  •  MKD  Creates a directory on the server
  •  RMD  Removes a directory from the server

This API makes it simple to transfer file to and from an FTP server. Here is an example of how to use the API to transfer a image file to a server.

.main testftp
.include "ftp_defines.def"
.align
record
    ftp  ,D_ADDR
    err  ,i4

.proc
    ;connect to ftp server
    err = %ftp_connect(ftp, "ftp.myserver.com", "username", "password")
    if (.not. err)
        begin
        ;upload image file to server
        err = %ftp_putfile(ftp, FTP_FILE, "c:\temp\logo.jpg",, FTP_BINARY, "logo.jpg")

        ;issue other ftp command to server here

        end
    ;disconnect from ftp server
    xcall ftp_disconnect(ftp)
.end

The API is written totally in Synergy DBL using the socket API, so it can be used on any platform that the Synergy Socket API is supported on.


For more information about this product or pricing please contact us

 

Valid HTML 4.01! Privacy Policy

Copyright © 1999-2007 PHF Consultancy
Banner images are trademarks of the companies represented