파일을 원격지에 전송할 일이 발생...
lftp 를 이용하여 파일 전송 ( CentOS 기본 설치 되어 있음 )
lftp -u ftpuser,password 원격지IP/경로1/경로2/ -e 'put 보낼파일; bye'
[ php 사용예 ]
<?php
$file = $_FILES["upfile"]["name"];
if ( !copy( $_FILES["upfile"]["tmp_name"] , $file ) )
{
$ftpTrans = "lftp -u testuser,testpass 123.456.789.123/temp/ftptest/ -e 'put ".$file."; bye'";
echo $ftpTrans;
shell_exec( $ftpTrans );
}
?>
'PHP' 카테고리의 다른 글
[그누보드] 메뉴/로그인 한글 영문(다국어) 처리 (0) | 2022.02.15 |
---|---|
[PHP] socket 오류 socket_connect() failed. (0) | 2017.10.25 |
[PHP] 절대경로 가져오기 dirname (0) | 2013.02.15 |
[PHP] 프레임워크(framework) (0) | 2013.02.15 |
[PHP] 페이지 성능 (소요시간) 측정 microtime (0) | 2013.02.14 |