|
제가 Indy FTP Server 컴포넌트를 사용해서 FTP server를 만들려고 하는고 있는데요.
서버생성을 해놓고 클라이언트에서 접속을 시도 하면 다음과 같이 에러나 나와서 해결방법좀 질문드려봅니다.
-파일질라로 접속 했을때 다음과 같이 나옵니다.-
상태: 192.168.10.20:21에 연결...
상태: 연결 수립, 환영 메시지를 기다림...
응답: 220 Indy FTP Server ready.
명령: USER Admin
응답: 331 User name okay, need password.
명령: PASS ****
응답: 230 User logged in, proceed.
명령: CLNT FileZilla
응답: 200 Noted.
명령: OPTS UTF8 ON
응답: 200 Ok
상태: 연결됨
상태: 디렉터리 목록 조회...
명령: PWD
응답: 257 "/" is working directory.
명령: TYPE I
응답: 200 Type set to I.
명령: PORT 192,168,10,20,8,133
응답: 502 PORT/EPRT Command disabled.
명령: PASV
응답: 227 Entering Passive Mode (192,168,10,20,67,112).
명령: MLSD
오류: 연결 시간 초과
오류: 디렉터리 목록 조회 실패
코딩부분
void __fastcall TForm1::IdFTPServer1UserLogin(TIdFTPServerContext *ASender, const UnicodeString AUsername,
const UnicodeString APassword, bool &AAuthenticated)
{
Memo1->Lines->Add("UserLogin");
AAuthenticated = ((AUsername == "Admin") && (APassword == "1234"));
if (!AAuthenticated) {
return;
}
ASender->HomeDir = "./";
ASender->CurrentDir = "/";
Memo1->Lines->Add(ASender->Username + "이 접속하였습니다.");
}
/--------------------------------------------------------------------------
void __fastcall TForm1::IdFTPServer1ListDirectory(TIdFTPServerContext *ASender, const UnicodeString APath,
TIdFTPListOutput *ADirectoryListing, const UnicodeString ACmd,
const UnicodeString ASwitches)
{
Memo1->Lines->Add("ListDirectory");
TSearchRec sr;
TIdFTPListItem *pItem;
int sri;
sri = FindFirst(APath + "/*.*", faAnyFile - faHidden - faSysFile, sr);
while (sri == 0)
{
pItem = ADirectoryListing->Add();
pItem->FileName = sr.Name;
pItem->Size = sr.Size;
pItem->ModifiedDate = FileDateToDateTime(sr.Time);
if (sr.Attr == faDirectory)
pItem->ItemType = ditDirectory;
else
pItem->ItemType = ditFile;
sri = FindNext(sr);
}
FindClose(sr);
Memo1->Lines->Add(ADirectoryListing->Count);
}
혹시 해결방법을 아시는분이 계시면 답변좀 부탁드립니다.
|