Home > Back-end >  IdFTP how to obtain IdFTPserver subdirectories
IdFTP how to obtain IdFTPserver subdirectories

Time:10-22

I hope in IDFTP client through TcomboBOX to select the server directory, then double-click the dynamic into the directory, this how to design??????

CodePudding user response:

Use the List for the List of files and directories on the FTP server
Function prototypes for
Procedure List (ADest: TStrings; Const ASpecifier: String; Const ADetails: Boolean);

CodePudding user response:

This ah, I know, but I double click on the contents of this directory later, when the server compile the code is wrong, I send up the code you see:
Procedure TFServer. IdFTPServer1StoreFile (ASender: TIdFTPServerThread;
Const AFileName: String; AAppend: Boolean; Var VStream: TStream);
Var
NewFile: String;
The begin
//will be used in the FTP directory of symbol "/" into Windows directory symbol ""
NewFile:=ChangeFolderChar (WorkDirectory. Text + AFileName);
//set up a corresponding files in the FTP server, and specify the file access interface
VStream:=TFileStream. Create (NewFile, fmCreate);
end;

The Function ChangeFolderChar (Str: String) : String;
//will be used in the FTP directory symbol "/" into "" in the Windows directory signs function
Var
I: Integer;
Mystr: string;
The begin
For I:=0 to length (Str) - 1 do
The begin
If the Str [I]='/' then
Str: [I]='\';
end;
Result:=Str;
end;

Then perform newfile right after the normal is C: \ \ folder a.t xt here into C: \ \ \ \ folder a.t xt then an error this directory cannot be found
  • Related