Command FTP_Send

4D Internet Commands

FTP_Send

version 6.5


FTP_Send (ftp_ID; localPath; hostPath; progress) Integer

ParameterTypeDescription
ftp_IDLongintReference to a FTP login
localPathTextPathname of document to send
hostPathTextPathname to destination of document
progressInteger1 = Show Progress, 0 = Hide Progress

Function result Integer Error Code

Description

Given a reference to an open FTP session, the pathname of a document to send and the destination pathname, the FTP_Send command sends the document to the remote machine. FTP_Send will return immediately if a FTP file status error occurs.

ftp_ID is the long integer reference to the FTP session established with FTP_Login.

localPath is the path of the document to be sent. If localPath is a null string, the user will be presented with the Standard Open File dialog. If localPath is a file name with no path, the command will look in the folder that contains the database structure (with 4D single-user) or in the 4D Client folder (with 4D Server) for the file. As with all paths to local documents, the directories should be seperated by a delimiter appropriate for the platform. For more information, see the section entitled Glossary and Terminology at the beginning of the manual.

hostPath is the path to the destination of the document, including the file name. The hostPath represents the desired name of the file once it has been received by the FTP server. If localPath is a null string allowing the user to pick a file from disk, then hostPath may also be a null string, in which case the chosen file's name will be used.

hostPath may be either a full pathname specification or simply a filename. If a full pathname is supplied, the specified file will be placed in the directory indicated by hostPath. If only a filename is provided, or null strings are used in the file selection, then the file will be sent to the Current Working Directory [CWD].

If the file or pathname cannot be resolved correctly, the command will return an error. If the user does not have enough privileges to send a file to that directory, an error will be returned. As with all paths to Unix documents, the path should be separated by slashes ("/"). For more information, see the section entitled Glossary and Terminology at the beginning of the manual.

progress is an integer value indicating whether the Progress indicator should be displayed or not. A value of 1 will display the progress indicator. A value of zero will hide the progress indicator.

Examples

Example 1

   $OK:=False
   Case of 
      : (FTP_Login ("ftp.4d.com";"anonymous";vEmailID;vFTP_ID;vFTP_Msg)#0)
      : (FTP_Progress (-1;-1;"Progress window";"Getting requested file…";"Cancel")#0)
      : (FTP_Send (vFTP_ID;"My Hard Drive:Documents:July Sales Report";"/pub/reports/";1)#0)
      : (FTP_Logout (vFTP_ID)#0)
   Else
      $OK:=True   `all commands executed without error
   End case 

Note: For more information about this particular use of the Case of structure, please refer to Appendix A, Programming Tips.

Example 2

   $error:=FTP_Send (vFTP_ID;"";"";1)

See Also

FTP_Progress, FTP_Receive.