[ Home ] [ Features ] [ Products ] [ FAQ's ] [ Screens ] [ Support ] [ Downloads ] [ About ] [ Discussion ]


the software that grows with you

 

V32Ftp()

Performs a designated command on a remote server.

Syntax

V32Ftp( <cServer>, <cUserName>, <cPassword>, <nPort>, <cCommand>, <cSource>, <cTarget>, <lWantInfo>, <lNotify>  )

Arguments

cServer Character string to represent the remote ftp server name. It can be the literal domain name as 'vouchcac.com' or its IP address as '178.12,213,97'.  It is a required parameter.
cUserName Character string specifying the user name needed to connect to the server. It is a required parameter.
cPassword Character string representing the password required to connect to the server. It is a required parameter.
nPort Numeric port number. Default is 21.
cCommand Character string specifying the command to be issued. on the remote server. It is required parameter. It can be one of the following:
GET Copies a file from remote server to local drive.
PUT Copies a local file on the remote server.
DIR Retrieves directory listing from the current directory of remote server. ( This version does not support this command )
CHDIR Makes current the directory specified on the remote server.
MKDIR Creates a specified directory on the remote server.
RMDIR Removes a specified directory from the remote server.
WKDIR Retrieves the full path of current directory from the remote server.
DEL Deletes a specified file from the remote server.
RENAME Renames an existing file on the remote server.
cSource Character string representing the source for <cCommand> to initiate. The value of <cSource> depends on the command being issued. Here is the <cCommand> : <cSource> relationship.

cCommand

cSource

GET File name at the remote server which has to be fetched.
PUT File name at local drive which have to be copied to remote server.
DIR NIL
CHDIR Directory name on the remote server which has to be made current.
MKDIR Directory name which has to be created on the server.
RMDIR Directory name on the remote server which has to be removed.
WKDIR NIL
DEL File name on the remote server which need be deleted.
RENAME File name on the remote server which need to be renamed.
cTarget Character string representing the source for <cCommand> to complete. The value of <cSource> depends on the command being issued. <cCommand>  :  <cTarget> relationship:

cCommand

cTaerget

GET File name at the local drive to store the retrieved file from the remote server.
PUT File name at remote server to store the uploaded file.
DIR NIL
CHDIR NIL
MKDIR NIL
RMDIR NIL
WKDIR NIL
DEL NIL
RENAME File name by which the existing file name on the remote server need to be renamed to.
lWantInfo Logical to specify whether info about the state of affairs is required or not. Default is FALSE.
lNotify Logical to specify whether a notification window be executed after completion of each command on the ftp. For more details about the notification window please see V32Notify() function details. Default is FALSE.

Returns

An array of information about which command is issued, which were the relevant parameters, and whether the command has been executed successfully, if <lWantInfo> is TRUE, otherwise array with an empty element

Description

Issues one of the commands described above on the remote server. As Vouch32, as it today, is not capable of issueing the multiple commands, all of them may not be useful all the time.

Usage

local cServer := 'MyServer.com'
local cUsername := 'pritpalbedi'
local cPassword := 'vouch32'
local nPort := 21
local cCommand := 'PUT'
local cSource := 'c:\config.sys'
local cTarget := 'temp\config.bak'
local lWantInfo := .t.
local aInfo := {}
local i

// Upload a file in temp folder of root directory of the server
aInfo := V32Ftp( cServer, cUsername, cPassword, nPort, cCommand, cSource, cTarget, lWantInfo )

// Download a file from root directory of the root server
cCommand := 'GET'
cSource := 'MyFile.zip'
cTarget := 'c:\MyFtp\MyFile.zip'
aInfo := V32Ftp( cServer, cUsername, cPassword, nPort, cCommand, cSource, cTarget, lWantInfo )

// Retrieve the complete path of the root directory on the server
cCommand := 'WKDIR'
aInfo := V32Ftp( cServer, cUsername, cPassword, nPort, cCommand, , , lWantInfo )

// Create a new directory on the remote server
cCommand := 'MKDIR'
cSource := 'MyZipFl'
aInfo := V32Ftp( cServer, cUsername, cPassword, nPort, cCommand, cSource, , lWantInfo )

// Delete a file from the remote server
cCommand := 'DEL'
cSource := 'temp\myfile.zip'
aInfo := V32Ftp( cServer, cUsername, cPassword, nPort, cCommand, cSource, , lWantInfo )

// Rename a file on the remote server
cCommand := 'RENAME'
cSource := 'Myfile.zip'
cTarget := 'Myfile.arc'
aInfo := V32Ftp( cServer, cUsername, cPassword, nPort, cCommand, cSource, cTarget, lWantInfo )

Tips

Vouch, my flagship ERP solution uses V32Ftp() to send zipped files created with V32ZipFiles() of important data onto a secure server. 

This feature can be used to upload application data onto the ftp server. You can design a two way communication, at one place data is uploaded and  at another it is downloaded without user even kowing what is happening in the background. A two way communication can be established thus making the application partially client/server.

 

[ Home ][ Features ] [ Products ][ About Us ][ FAQ's ][ Screen Shots ][ Downloads ][ Support ][ Discussion ]
.

Vouch is a Trademark of Pritpal Bedi
All other Trade Marks are the property of their respective owners.
Copyright 1993-2011 Pritpal Bedi. All rights reserved.
Hit Counter  
You are Visitor # since 14 May 2002