3
ftp_put을 사용할 때 현재 디렉토리에없는 파일을 처리하는 방법은 무엇입니까? 이 코드는 내가 알고있는 파일을 업로드하려하지만 항상 다음 오류를 제공합니다.PHP ftp_put - 파일을 찾을 수 없거나 액세스 할 수 없음
"경고 : ftp_put() [function.ftp-put] : 요청한 작업을 수행하지 못했습니다. 파일을 찾을 수 없습니다. .
$file_name = $this->GetFileName();
if ($file_name)
{
$resource = ftp_connect('ftp.remoteftpserver.com');
if ($resource && ftp_login($resource, $username, $pass))
{
ftp_pasv($resource, true);
//UPLOAD_DIRECTORY == '/IN' (it really exists, I'm sure)
//ORDER_DIRECTORY == /home/domains/mydomain.com/orders (came from $_SERVER['DOCUMENT_ROOT']
ftp_put($resource, UPLOAD_DIRECTORY . '/' . $file_name, ORDER_DIRECTORY . '/' . $file_name, FTP_ASCII);
ftp_close($resource);
}
else
{
echo "FTP Connection Failed!";
}
}