{"id":669,"date":"2002-11-19T04:50:48","date_gmt":"2002-11-19T04:50:48","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=669"},"modified":"2002-11-19T04:50:48","modified_gmt":"2002-11-19T04:50:48","slug":"ftp%ec%a0%9c%ea%b7%80%ed%98%b8%ec%b6%9c%ec%9d%84-%ec%9d%b4%ec%9a%a9%ed%95%9c-%ec%84%9c%eb%b8%8c%eb%94%94%eb%a0%89%ed%86%a0%eb%a6%ac-%eb%b0%8f-%ed%8c%8c%ec%9d%bc-%ec%97%85%eb%a1%9c%eb%93%9c","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=669","title":{"rendered":"[FTP]\uc81c\uadc0\ud638\ucd9c\uc744 \uc774\uc6a9\ud55c \uc11c\ube0c\ub514\ub809\ud1a0\ub9ac \ubc0f \ud30c\uc77c \uc5c5\ub85c\ub4dc"},"content":{"rendered":"<p>{FTP \uc18c\ucf13\uc811\uc18d}<br \/>\n\/\/\uc5c5\ub85c\ub4dc\uac00 \ub2e4 \ub420\ub54c\uae4c\uc9c0 \uc7a1\uace0\uc788\ub294\ub2e4 \u3161\u3161\u314b<br \/>\nset_time_limit(600); \/\/ 60\ubd84<\/p>\n<p>\/\/\uc11c\ube0c\ub514\ub809\ud1a0\ub9ac\uae4c\uc9c0 \uc5c5\ub85c\ub4dc(\uc7ac\uadc0\ud638\ucd9c)<br \/>\n\/\/$src_dir &#8211; \uc5c5\ub85c\ub4dc\ub420\uacf3\uacbd\ub85c, $dist_dir &#8211; \uc5c5\ub85c\ub4dc\ud560 \ud30c\uc77c\uc774 \uc788\ub294 \uacbd\ub85c<br \/>\nfunction ftp_copy($src_dir, $dist_dir) {<br \/>\nglobal $connect;<br \/>\n  $d = dir($src_dir);<br \/>\n  while($file = $d->read()) {<br \/>\n    if ($file != &#8220;.&#8221; &#038;&#038; $file != &#8220;..&#8221;) {<br \/>\n      if (is_dir($src_dir.&#8221;\/&#8221;.$file)) {<br \/>\n        if (!@ftp_chdir($connect, $dist_dir.&#8221;\/&#8221;.$file)) {<br \/>\n          @ftp_mkdir($connect, $dist_dir.&#8221;\/&#8221;.$file);<br \/>\n        }<br \/>\n        @ftp_copy($src_dir.&#8221;\/&#8221;.$file, $dist_dir.&#8221;\/&#8221;.$file);<br \/>\n      }else {<br \/>\n        $upload = @ftp_put($connect, $dist_dir.&#8221;\/&#8221;.$file, $src_dir.&#8221;\/&#8221;.$file, FTP_BINARY);<br \/>\n        if(!$upload) {<br \/>\n          echo &#8220;<script>alert('\uc5c5\ub85c\ub4dc\uc5d0 \uc2e4\ud328\ud558\uc600\uc2b5\ub2c8\ub2e4.'); history.go(-1);<\/script>&#8220;;<br \/>\n          exit;<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n  $d->close();<br \/>\n}<\/p>\n<p>\/\/\uc5c5\ub85c\ub4dc \ub514\ub809\ud1a0\ub9ac\ub85c \uc774\ub3d9<br \/>\n$result = chdir(&#8220;upload&#8221;);<br \/>\nif(!$result) {<br \/>\n  echo &#8220;<script>alert('\uc774\ub3d9\uc2e4\ud328-_-+'); history.go(-1);<\/script>&#8220;;<br \/>\n  exit;<br \/>\n}<\/p>\n<p>\/\/\ud30c\uc77c\uc5c5\ub85c\ub4dc\ud558\uae30<br \/>\nftp_pasv($connect,TURE);<br \/>\nftp_copy(&#8220;.\/&#8221;,&#8221;.\/&#8221;);<br \/>\nftp_pasv($connect,FALSE);<\/p>\n<p>\/\/\uc885\ub8cc<br \/>\nftp_quit($connect);<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n\uc5ec\uae30\uae4c\uc9c0\uc774\uba70 upload \ud3f4\ub354\uc548\uc5d0 \ubaa8\ub4e0 \ud30c\uc77c\uacfc \ub514\ub809\ud1a0\ub9ac\ub97c \uc5c5\ub85c\ub4dc \ud569\ub2c8\ub2e4. ^^<br \/>\n\uc798 \uc751\uc6a9\ud574\uc11c \uc0ac\uc6a9\ud558\uc138\uc694 ^^ <\/p>\n","protected":false},"excerpt":{"rendered":"<p>{FTP \uc18c\ucf13\uc811\uc18d} \/\/\uc5c5\ub85c\ub4dc\uac00 \ub2e4 \ub420\ub54c\uae4c\uc9c0 \uc7a1\uace0\uc788\ub294\ub2e4 \u3161\u3161\u314b set_time_limit(600); \/\/ 60\ubd84 \/\/\uc11c\ube0c\ub514\ub809\ud1a0\ub9ac\uae4c\uc9c0 \uc5c5\ub85c\ub4dc(\uc7ac\uadc0\ud638\ucd9c) \/\/$src_dir &#8211; \uc5c5\ub85c\ub4dc\ub420\uacf3\uacbd\ub85c, $dist_dir &#8211; \uc5c5\ub85c\ub4dc\ud560 \ud30c\uc77c\uc774 \uc788\ub294 \uacbd\ub85c function ftp_copy($src_dir, $dist_dir) { global $connect; $d = dir($src_dir); while($file = $d->read()) { if ($file != &#8220;.&#8221; &#038;&#038; $file != &#8220;..&#8221;) { if (is_dir($src_dir.&#8221;\/&#8221;.$file)) { if (!@ftp_chdir($connect, $dist_dir.&#8221;\/&#8221;.$file)) { @ftp_mkdir($connect, $dist_dir.&#8221;\/&#8221;.$file); } @ftp_copy($src_dir.&#8221;\/&#8221;.$file, $dist_dir.&#8221;\/&#8221;.$file); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-669","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=669"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/669\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}