PHP¸¦ ÀÌ¿ëÇÏ¿© FTPÇÁ·Î±×·¥À» ¸¸µé ¼ö ÀÖ½À´Ï´Ù.
±â´ÉÀº ¾÷·Îµå, ´Ù¿î·Îµå, ¼Ò½º¼öÁ¤, À̸§º¯°æ, ºê¶ó¿ìÀú ºä, ÆÄÀϸ¸µé±â, µð·ºÅ丮 »èÁ¦, µð·ºÅ丮 À̵¿, ±ÇÇѺ¯°æ ÀÌ °¡´ÉÇÕ´Ï´Ù.
ÇÔ¼ö¸¸ °£´ÜÈ÷ ¼³¸í µå¸®°Ù½À´Ï´Ù.
FTPÇÔ¼öÀÇ Á¾·ù¿Í »ç¿ë¹ý
(1) ftp_connect : FTP¼¹ö¿¡ ¿¬°áÇÑ´Ù.
-----------------------------------------------
int ftp_connect (string host [, int port])
$ftp=ftp_connect("¼¹öÁÖ¼Ò ¶Ç´Â µµ¸ÞÀθí",21);
-----------------------------------------------
(2) ftp_login : °èÁ¤°ú Æнº¿öµå·Î ¼¹ö¿¡ Á¢±ÙÇÑ´Ù.
-----------------------------------------------
int ftp_login (int ftp_stream, string username, string password)
$ftplogin = ftp_login($ftp, "$ftp_user_name", "$ftp_user_pass");
-----------------------------------------------
(3) ftp_pwd : ÇöÀç µð·ºÅ丮 °ªÀ» ¸®ÅÏÇÑ´Ù.
-----------------------------------------------
int ftp_pwd (int ftp_stream)
$ftp_dir = $ftp_pwd($ftp);
-----------------------------------------------
(4) ftp_cdup : °¡Àå »óÀ§ µð·ºÅ丮·Î À̵¿
-----------------------------------------------
int ftp_cdup (int ftp_stream)
$ftp_dir = $ftp_cdup($ftp);
-----------------------------------------------
(5) ftp_chdir : FTP µð·ºÅ丮ÀÇ º¯°æ
-----------------------------------------------
int ftp_chdir (int ftp_stream, string directory)
$chdir=ftp_chdir ($ftp, $ftp_dir);
-----------------------------------------------
(6) ftp_mkdir : µð·ºÅ丮¸¦ ¸¸µé°í ¸¸µç µð·ºÅ丮¸íÀ» ¹ÝȯÇÑ´Ù.
-----------------------------------------------
string ftp_mkdir (int ftp_stream, string directory)
$mkdir = ($ftp,"¸¸µé µð·ºÅ丮¸í");
-----------------------------------------------
(7) ftp_rmdir : µð·ºÅ丮¸¦ »èÁ¦ÇÑ´Ù.
-----------------------------------------------
int ftp_rmdir (int ftp_stream, string directory)
$mkdir = ($ftp,"»èÁ¦ÇÒ µð·ºÅ丮¸í");
-----------------------------------------------
(8) ftp_nlist : µð·ºÅ丮ÀÇ ÆÄÀÏÀ̸§À» ¹è¿·Î ¹ÝȯÇÑ´Ù.
-----------------------------------------------
int ftp_nlist (int ftp_stream, string directory)
$contents = ftp_nlist( $ftp, "µð·ºÅ丮¸í");
-----------------------------------------------
(9) ftp_rawlist : µð·ºÅ丮ÀÇ ÆÄÀÏÀ̸§°ú ÀÐ°í ¾²°í ½ÇÇàÇÒ ±ÇÇÑÀ» ÆÄÀÏ ´ç ÇÑ ÁÙÀÇ ¹è¿·Î ¹ÝȯÇÑ´Ù.
-----------------------------------------------
int ftp_rawlist (int ftp_stream, string directory)
$contents = ftp_nlist( $ftp, "µð·ºÅ丮¸í");
-----------------------------------------------
(10) ftp_systype : FTP¼¹öÀÇ Å¸ÀÔÀ» ¸®ÅÏÇϴµ¥ ¸®´ª½º´Â UNIX·Î Ç¥½ÃÇØÁØ´Ù.
-----------------------------------------------
int ftp_systype (int ftp_stream)
echo ftp_systype($ftp);
-----------------------------------------------
(11) ftp_get : FTP·ÎºÎÅÍ ÆÄÀÏÀ» ´Ù¿î·Îµå ¹Þ´Â´Ù.
-----------------------------------------------
int ftp_get (int ftp_stream, string local_file, string remote_file, int mode)
$download = ftp_get($ftp, "ÀúÀåÇÒ ÆÄÀϸí", "´Ù¿î¹ÞÀ» ÆÄÀϸí","FTP_ASCII or FTP_BINARY");
-----------------------------------------------
.pl ¶Ç´Â .cgi °°Àº Perl CGIÀÎ °æ¿ì¿¡´Â FTP_ASCII·Î ´Ù¿î ¹Þ°í ´Ù¸¥ ÆÄÀÏÀº FTP_BINARY·Î ´Ù¿î ¹Þ¾Æ¾ß ÇÑ´Ù.
(12) ftp_fget : FTP·ÎºÎÅÍ ÆÄÀÏ Æ÷ÀÎÅ͸¦ ´Ù¿î¹Þ´Â´Ù.
-----------------------------------------------
int ftp_fget (int ftp_stream, int fp, string remote_file, int mode)
$download = ftp_fget($ftp, "ÀúÀåÇÒ ÆÄÀϸí", "´Ù¿î¹ÞÀ» ÆÄÀϸí","FTP_ASCII or FTP_BINARY");
-----------------------------------------------
(13) ftp_put : FTP¼¹ö¿¡ ÆÄÀÏÀ» ¾÷·Îµå ÇÑ´Ù.
-----------------------------------------------
int ftp_put (int ftp_stream, string remote_file, string local_file, int mode)
$upload = ftp_put($ftp, "¾÷·ÎµåÇÒ ÆÄÀϸí", "¾÷·ÎµåµÉ ÆÄÀϸí","FTP_ASCII or FTP_BINARY");
-----------------------------------------------
(14) ftp_fput : FTP¼¹ö¿¡ ÆÄÀÏ Æ÷ÀÎÅ͸¦ ¾÷·ÎµåÇÑ´Ù.
-----------------------------------------------
int ftp_fput (int ftp_stream, string remote_file, string local_file, int mode)
$upload = ftp_fput($ftp, "¾÷·ÎµåÇÒ ÆÄÀϸí", "¾÷·ÎµåµÉ ÆÄÀϸí","FTP_ASCII or FTP_BINARY");
-----------------------------------------------
(15) ftp_size : ÆÄÀÏÀÇ »çÀÌÁ ±¸ÇÑ´Ù.
-----------------------------------------------
int ftp_size (int ftp_stream, string remote_file)
$filesize = ftp_size( $ftp, $contents[$i] );
-----------------------------------------------
ftp_nlist ³ª ftp_rawlist¿¡ ÀÇÇØ ±¸ÇÑ ÆÄÀÏ¸í¿¡ ´ëÇÑ ¹è¿°ªÀÎ $contents[$i]¿¡´Â °¢ ÆÄÀϸí°ú ¼Ó¼ºÀÌ ÀúÀåµÇ¾îÁö´Âµ¥ ÀÌ ÆÄÀϸíÀ» »çÀÌÁî·Î ±¸Çϸé ÆÄÀÏÀÌ¸é »çÀÌÁî°¡ ¸®ÅÏµÇ°í µð·ºÅ丮À̸é -1ÀÌ ¸®ÅϵȴÙ.
(16) ftp_mdtm : ÆÄÀÏÀÇ ¸¶Áö¸· ¼öÁ¤½Ã°£À» timestamp °ªÀ¸·Î ¸®ÅÏÇÑ´Ù.
-----------------------------------------------
int ftp_mdtm (int ftp_stream, string remote_file)
$filemdth = ftp_size( $ftp, "ÆÄÀѸí");
-----------------------------------------------
(17) ftp_rename : ÆÄÀϸíÀ» º¯°æÇÑ´Ù.
-----------------------------------------------
int ftp_rename (int ftp_stream, string from, string to)
$rename = ftp_rename( $ftp, "¹Ù²Ü ÆÄÀϸí", "¹Ù²ï ÈÄ ÆÄÀϸí");
-----------------------------------------------
(18) ftp_delete : ÇØ´ç ÆÄÀÏÀ» »èÁ¦ÇÑ´Ù.
-----------------------------------------------
int ftp_delete (int ftp_stream, string path)
$delfile = ftp_delete($ftp, "Áö¿ï ÆÄÀϸí");
-----------------------------------------------
(19) ftp_quit : ¿¬°áµÈ FTPÀÇ Á¢¼ÓÀ» ²÷´Â´Ù.
-----------------------------------------------
int ftp_quit (int ftp_stream)
ftp_quit ($ftp);
-----------------------------------------------
| |