standard.net.ftp.FtpAccess

FtpAccess is available since version 1.0.

Prototype:

number FtpAccess(string path, number mode, number connection_handle)

Parameters

path
the ftp file path
mode
the ftp mode: FTPLIB_ASCII or FTPLIB_IMAGE
connection_handle
the connection handle as returned by FtpConnect.

Description:

Gets a handle for an ftp data stream. You can use FtpRead and FtpWrite to read or write data.

Return value:

Returns null if failed, or a handle to a data stream.

Example
	function TestFtp() {
		var con=FtpConnect("ftp.rdsct.ro");
		if (!con) {
			echo "Can't Connect\n";
			return 0;
		} else {
			echo "Connected !!!\n";
		}
		FtpLogin("","",con);
		//if (!FtpGet("c:\\test.zip","/pub/PPPoE/win98/RASPPPOE_098B.ZIP",FTPLIB_IMAGE,con))
		//	echo "Error getting file\n";
		var ftpfile=FtpAccess("/pub/PPPoE/win98/RASPPPOE_098B.ZIP",FTPLIB_FILE_READ,FTPLIB_IMAGE,con);
		if (ftpfile) {
			echo "File opened !\n";
			echo FtpRead(1,ftpfile);
			FtpClose(ftpfile);
		}
		FtpQuit(con);
	}