Puts a file on a remote server using GridFTP.
gd_putfile(host,localfile,remotefile)
gd_putfile(host,localfile,remotefile,filetype)
gd_putfile(host,localfile,remotefile,filetype,ispassive)
This command puts a local file upon a remote server using GridFTP. The user must specify the remote server name, the local file path, and the remote file path. The user can also specify the filetype.
gd_putfile(host,localfile,remotefile) transfers the ASCII file localfile to the machine host. The file is saved to the path and file specified by the string remotefile.
gd_putfile(host,localfile,remotefile,filetype) as above except the string filetype sets the file transfer type. When filetype = 'ASCII' the file transfer type will be ASCII (this is the default setting), alternatively when filetype = 'binary' the file transfer type is set to binary.
gd_putfile(host,localfile,remotefile,filetype,ispassive) where if ispassive is false the active FTP mode will be used, otherwise the default passive FTP mode will be used. If a passive connection cannot be established a warning is displayed and an active mode connection will be attempted.
The following command places the local file 'C:\data1.dat' on the remote host 'server' in the users home directory with the file name 'data2.dat'. The file is transferred as a binary file type.
gd_putfile('server.domain.com','C:\data1.dat','data2.dat', 'binary');
This example behaves as above except the file is placed in the existing subdirectory to the users home directory; 'tmp'.
gd_putfile('server.domain.com','C:\data1.dat','tmp/data2.dat', 'binary');
This example is similar to the first example except the file is placed in the subdirectory to the root directory; 'tmp'.
gd_putfile('server.domain.com','C:\data1.dat','/tmp/data2.dat','binary');
A valid proxy certificate is required to use GridFTP. Suitable credentials may be required to transfer files to remote servers.
In earlier versions of this function the default FTP mode was active. The passive mode is now used by default since this is may be more appropriate when the GridFTP client is behind a firewall which blocks incoming connections.
Copyright © 2007, The Geodise Project, University of Southampton