idFTPserver
Mam mensi problem vse funguje az na jedno v Totalcmd , FF se nezobrazi zadna data ale pri zadani cilove adresi vse probehne OK, problem spociva v tom ze IE zobrazi vsechna data korektne nastaveni emulace je ftpsdos , pri ftpsvax nic nezobrazi a ftpslinux zobrazi data i slozky ale slozky nelze otevrit kde muze byt chyba ??
Prvni cast :
procedure TForm1.IdFTPServer1AfterUserLogin(ASender: TIdFTPServerThread);
begin
ASender.HomeDir := '\';
ASender.CurrentDir := '\';
appdir := ExtractFilePath('f:\AppServ\generals\');
end;
procedure TForm1.IdFTPServer1UserLogin(ASender: TIdFTPServerThread;
const AUsername, APassword: String; var AAuthenticated: Boolean);
begin
AAuthenticated := ((AUsername = 'certcv') and (APassword = 'opicak'));
if AAuthenticated = true then
begin
listbox1.Items.Add(AUsername);
end;
end;
procedure TForm1.IdFTPServer1StoreFile(ASender: TIdFTPServerThread;
const AFileName: String; AAppend: Boolean; var VStream: TStream);
begin
if not Aappend then
begin
VStream := TFileStream.Create(appdir + AFilename,fmCreate);
end;
if Aappend then
begin
VStream := TFileStream.Create(appdir + AFilename,fmOpenReadWrite);
end;
end;
procedure TForm1.IdFTPServer1RetrieveFile(ASender: TIdFTPServerThread;
const AFileName: String; var VStream: TStream);
begin
VStream := TFileStream.Create(AppDir + AFilename,fmOpenRead);
Application.ProcessMessages;
end;
procedure TForm1.IdFTPServer1ChangeDirectory(ASender: TIdFTPServerThread;
var VDirectory: String);
begin
Asender.CurrentDir := VDirectory;
change_dir := VDirectory;
VDirectory:='';
end;
procedure TForm1.IdFTPServer1ListDirectory(ASender: TIdFTPServerThread;
const APath: String; ADirectoryListing: TIdFTPListItems);
var
LFTPItem :TIdFTPListItem;
SR : TSearchRec;
SRI : Integer;
begin
SRI := FindFirst(AppDir + change_dir + '*.*', faAnyFile - faHidden - faSysFile, SR);
While SRI = 0 do
begin
LFTPItem := ADirectoryListing.Add;
LFTPItem.FileName := SR.Name;
LFTPItem.Size := SR.Size;
LFTPItem.ModifiedDate := FileDateToDateTime(SR.Time);
Application.ProcessMessages;
if SR.Attr = faDirectory then
LFTPItem.ItemType := ditDirectory
else
LFTPItem.ItemType := ditFile;
SRI := FindNext(SR);
end;
FindClose(SR);
SetCurrentDir(AppDir + '..');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IdFTPServer1.DefaultPort:=spinedit1.Value;
IdFTPServer1.DefaultDataPort:=spinedit1.Value-1;
IdFTPServer1.Active:=true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
IdFTPServer1.Active:=false;
end;
procedure TForm1.IdFTPServer1Connect(AThread: TIdPeerThread);
begin
AThread.Connection.WriteLn('Vitej cerve zde muzes sosat');
end;
procedure TForm1.IdFTPServer1Disconnect(AThread: TIdPeerThread);
begin
listbox1.Items.Add(AThread.TerminatingException+'odpojen');
end;
Druha cast:
Server je spusten muzete otestovat heslo a jmeno je stejne jako ve zdrojaku.
No jo... ale kde je spusten?
certcv.com pardon zapomel jsem dopsat
Nikdo nevi ??
Nic nevím, pouze jsem jej zkoušel řádkovým NT FTP klientem, výsledek je tento:
Je mozne ze v tu dobu jsem zkousel upravu ale byla knicemu ted ho nechavam spusten trvale ale obcas se stane ze nacitany soubor je jen polovicni coz mne zarazi .
Problem jsem vyresil , predelal jsem to v Indy 10 a vse funguje jak ma.