AUTO
[ID/PWã±â] [ȸ¿ø°¡ÀÔ]
´º½º¿Í Á¤º¸ (276)
ÀÚÀ¯ °Ô½ÃÆÇ (392)
°¡ÀÔ Àλç (1960)
°øÁö»çÇ× (5)
AJAX ÇнÀ (72)
ASP Áú¹® (71)
ASP ÇнÀ (271)
MYSQL ÇнÀ (73)
SQLSERVER ÇнÀ (337)
¿À¶óŬ ÇнÀ (66)
µ¥ÀÌŸº£À̽º ÇнÀ (29)
¾×¼Ç½ºÅ©¸³Æ® ÇнÀ (261)
¾×¼Ç½ºÅ©¸³Æ® Áú¹® (65)
ÆÛ¿Â Ç÷¡½Ã (204)
Ç÷¡½Ã ³×ºñ°ÔÀÌ¼Ç (59)
Ç÷¡½Ã ¼Ò½º (532)
Ç÷¡½Ã ¿¬±¸½Ç (536)
Ç÷¡½Ã Áú¹® (647)
Ç÷¡½Ã °ÔÀÓ (53)
Ç÷¡½Ã ÀÎÆ®·Î (44)
Ç÷¡½Ã ÀÌÆåÆ® (45)
ÀÚÀÛ Ç÷¡½Ã (83)
ű×,HTML Áú¹® (43)
ű×,HTML ÇнÀ (131)
ÀÚ¹Ù,JSP ÇнÀ (161)
ÀÚ¹Ù,JSP Áú¹® (70)
ÀÚ¹Ù½ºÅ©¸³Æ® ÇнÀ (223)
ÀÚ¹Ù½ºÅ©¸³Æ® ¼Ò½º (73)
ÀÚ¹Ù½ºÅ©¸³Æ® Áú¹® (79)
Æ÷Åä¼¥ Áú¹® (108)
Æ÷Åä¼¥ ÇнÀ (369)
Ãßõ À̹ÌÁö (239)
ÀÚÀÛ À̹ÌÁö (81)
ÆÛ¿Â À̹ÌÁö (445)
PHP Áú¹® (62)
PHP ÇÔ¼ö (2658)
PHP ÇнÀ (661)
ÇÁ·Î±×·¡¹Ö ÇнÀ (205)
ÀÎÅͳݼ­¹ö ÇнÀ (346)
ÀÎÅͳݼ­¹ö Áú¹® (22)
³×À̹ö ¼Ó ȨÇǵðÀÚÀδåÄÄ
´ÙÀ½ ¼Ó ȨÇǵðÀÚÀδåÄÄ
±¸±Û ¼Ó ȨÇǵðÀÚÀδåÄÄ
¿¥ÆÄ½º ¼Ó ȨÇǵðÀÚÀδåÄÄ
¾ßÈÄ ¼Ó ȨÇǵðÀÚÀδåÄÄ
³×ÀÌÆ® ¼Ó ȨÇǵðÀÚÀδåÄÄ
½ÎÀÌ¿ùµå ȨÇǵðÀÚÀδåÄÄ
¿¥¿¡½º¿£ ȨÇǵðÀÚÀδåÄÄ
  ȨÇǵðÀÚÀδåÄÄ > PHP ÇÔ¼ö
   
  ftp_chmod
  ±Û¾´ÀÌ : ¼Õ´Ô     ³¯Â¥ : 06-01-04 08:26     Á¶È¸ : 920    
   http://cafe.naver.com/q69/10157 (109)

ftp_chmod

(PHP 5)

ftp_chmod -- Set permissions on a file via FTP

Descript-xion

string ftp_chmod ( resource ftp_stream, int mode, string filename)

Sets the permissions on the remote file specified by filename to mode given as an octal value.

¿¹ 1. ftp_chmod() example

<?php
$file
= 'public_html/index.php'
;

// set up basic connection
$conn_id = ftp_connect($ftp_server
);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass
);

// try to chmod $file to 644
if (ftp_chmod($conn_id, 0644, $file
)) {
 echo
"$file chmoded successfully to 644\n"
;
} else {
 echo
"could not chmod $file\n"
;
}

// close the connection
ftp_close($conn_id
);
?>

Returns the new file permissions on success or FALSE on error.

See also chmod().



add a note add a note User Contributed Notes
ftp_chmod
Ilya
28-Nov-2005 07:29
NB: In the last function the value passed to ftp_chmod is the decimal transliteration of octal. I.e. chmod(... 0755 ...) is equivalent to ftp_chmod(... 755 ...).
hardy add mapscene dot com
09-Oct-2005 10:44
//php4 equivalent of the php5 function
if (!function_exists('ftp_chmod')) {
   function ftp_chmod($ftpstream,$chmod,$file)
   {
       $old=error_reporting();//save old
       error_reporting(0);//set to none
       $result=ftp_site($ftpstream, "CHMOD ".$chmod." ".$file);
       error_reporting($old);//reset to old
       return $result;//will result TRUE or FALSE
   }
}

//demonstration of the function
$ftp_ip="yourserverip";
$ftp_login="theuser";
$ftp_pass="thepassword";
$ftp_file="test.txt";

$conn_id=ftp_connect($ftp_ip);
$login_result=@ftp_login($conn_id, $ftp_login, $ftp_pass);
if(ftp_chmod($conn_id,"0775",$ftp_file)==FALSE)print"ERROR FTP_CHMOD: can't change chmod of $ftp_file";

ftp_quit($conn_id);
tim at timboring dot com
08-Feb-2005 08:50
Just to clarify, ftp_chmod() works just fine.  I'm using it with php-4.3.10.  I used the same code given in the orginal documentation and was able to chmod a file on an ftp server.
Loup_iotte at pagesperso dot org
01-Jul-2003 06:07
if ftp_chmod doesn't work, jusdt try this :

$ftp_ip="ip_of_my_serv_ftp";
$ftp_login="my_login";
$ftp_pass="my_pass";
$ftp_file="/www/motd.txt";

$conn_id=ftp_connect($ftp_ip);
$login_result=@ftp_login($conn_id, $ftp_login, $ftp_pass);

<!-- Here's the hack -->
$chmod_cmd="CHMOD 0666 ".$ftp_file;
$chmod=ftp_site($conn_id, $chmod_cmd);


ftp_quit($conn_id);

Loup_iotte

   

 
´º½º¿Í Á¤º¸ ¡¤ ÀÚÀ¯ °Ô½ÃÆÇ ¡¤ °¡ÀÔ ÀÎ»ç ¡¤ °øÁö»çÇ× ¡¤ AJAX ÇнÀ ¡¤ ASP Áú¹® ¡¤ ASP ÇнÀ ¡¤ MYSQL ÇнÀ ¡¤ SQLSERVER ÇнÀ ¡¤ ¿À¶óŬ ÇнÀ ¡¤ µ¥ÀÌŸº£À̽º ÇнÀ ¡¤ ¾×¼Ç½ºÅ©¸³Æ® ÇнÀ ¡¤ ¾×¼Ç½ºÅ©¸³Æ® Áú¹® ¡¤ ÆÛ¿Â Ç÷¡½Ã ¡¤ Ç÷¡½Ã ³×ºñ°ÔÀÌ¼Ç ¡¤ Ç÷¡½Ã ¼Ò½º ¡¤ Ç÷¡½Ã ¿¬±¸½Ç ¡¤ Ç÷¡½Ã Áú¹® ¡¤ Ç÷¡½Ã °ÔÀÓ ¡¤ Ç÷¡½Ã ÀÎÆ®·Î ¡¤ Ç÷¡½Ã ÀÌÆåÆ® ¡¤ ÀÚÀÛ Ç÷¡½Ã ¡¤ ű×,HTML Áú¹® ¡¤ ű×,HTML ÇнÀ ¡¤ ÀÚ¹Ù,JSP ÇнÀ ¡¤ ÀÚ¹Ù,JSP Áú¹® ¡¤ ÀÚ¹Ù½ºÅ©¸³Æ® ÇнÀ ¡¤ ÀÚ¹Ù½ºÅ©¸³Æ® ¼Ò½º ¡¤ ÀÚ¹Ù½ºÅ©¸³Æ® Áú¹® ¡¤ Æ÷Åä¼¥ Áú¹® ¡¤ Æ÷Åä¼¥ ÇнÀ ¡¤ Ãßõ À̹ÌÁö ¡¤ ÀÚÀÛ À̹ÌÁö ¡¤ ÆÛ¿Â À̹ÌÁö ¡¤ PHP Áú¹® ¡¤ PHP ÇÔ¼ö ¡¤ PHP ÇнÀ ¡¤ ÇÁ·Î±×·¡¹Ö ÇнÀ ¡¤ ÀÎÅͳݼ­¹ö ÇнÀ ¡¤ ÀÎÅͳݼ­¹ö Áú¹®¡¤ Ç÷¡½Ã »ùÇà ¼Ò½º ¡¤ Ç÷¡½Ã äÆÃ¹æ ¡¤ Ç÷¡½Ã ¹Ì´ÏȨÇÇ ¡¤ Ç÷¡½Ã °¶·¯¸® ¡¤ Ç÷¡½Ã RSS¸®´õ ¡¤ Ç÷¡½Ã PHP »çÀü ¡¤ Ç÷¡½Ã ¿ìÆí¹øÈ£ ã±â ¡¤ Ç÷¡½Ã ÇÑÀÚ°ÔÀÓ ¡¤ Ç÷¡½Ã ´Þ·Â°ú½Ã°è ¡¤ Ç÷¡½Ã Æ÷Åä¶óÀ̺귯¸® ¡¤ ·£´ýÀ̹ÌÁö ¡¤ Ç÷¡½Ã ´Þ·Â°ú½Ã°è ¡¤ ÇÑ±Û µµ¸ÞÀÎ ¡¤ ³×À̹ö ºí·Î±× ½ºÅ©·¦ ¡¤ ½ÎÀÌ¿ùµå ¹Ì´ÏȨÇÇ °¶·¯¸® ¡¤ ½ÎÀÌ¿ùµå ¹Ì´ÏȨÇÇ µî·Ï ¡¤ ÇÁ·Î°ÔÀÌ¸Ó ·©Å© ¡¤ ȨÆäÀÌÁöÁ¤º¸ ºí·Î±×
Copyright ¨Ï hompy.info. All rights reserved.