Home > Back-end >  Delphi FTP server via idftp connection on why some use broadband networks outside even not hot but c
Delphi FTP server via idftp connection on why some use broadband networks outside even not hot but c

Time:11-04

Network clients use everything is normal, the network via a browser, folders can be normal access to the FTP server, but there are some users with Delphi program but it was not even on the FTP server, it is strange that the computer network switch to mobile hotspot Shared network but can be connected, and even some normal use for more than a year, suddenly can't even, can only use mobile hotspot, filezilla FTP server, set the passive mode,

Procedure Tsorder4Form. Cxbtn1Click (Sender: TObject);
Var
BC, sp, sf, fd, s, sf1, wj: string;
FTP: tidftp;
LST: TStrings;
The begin
With TIdFTP. Create (nil) do
Try
Port:=gftp_port;
Passive:=true;
PassiveUseControlHost:=true;

Host:=gFtpserver;
Username:=gftp_user;
Password:=gftp_pass;

LST:=TStringList. Create;

Try
The Connect.//an error here, even not on the FTP server, with mobile hotspot network is normal

Cxm1. Lines. The Clear;
Cxm1. Lines. The Add (' start download file... ');
Tblo. First;
While not tblo. EOF do
The begin
BC:=tblo FieldByName (' bcode). The Value;
Sp:=Format (' \ what \ % s \ % s \ ', [formatdatetime (' yyyymmdd 'tblo. FieldByName (' bdate). AsDateTime), BC]);
Fd:=cxbtndt1. Text;

If tblo. FieldByName (' file1) IsNull then
Sf:='
The else
Sf:=tblo FieldByName (" file1 "). The Value;

If sf, & lt;> "' then
The begin
Try
Sf1:=tblo FieldByName (' wo_id). AsString + '_' + sf;
If FileExists (fd + sf1) then DeleteFile (fd + sf1);

Get (sp + sf, fd + sf1);
Except,
On e: the Exception do
The begin
If FileExists (fd + sf1) then DeleteFile (fd + sf1);
Cxm1. Lines. The Add (Format (' % s does not exist. File % s', [the BC, sf1]));
end;
end;
end;
Tblo. Next;
Application. ProcessMessages;
end;
Cxm1. Lines. The Add (' end of the file download. ');

OpenDialog (s, 'browse the file', 'all files (*. *)', '*. *' true, fd);
Except,
On e: the Exception do
The begin
Cxm1. Lines. The Add (' connection file server error: '+ e.M essage);
end;
end;
The finally
If Connected then Disconnect;
Free;
LST. Free;
end;
end;

CodePudding user response:

No IP networks outside,

CodePudding user response:




To download program errors

CodePudding user response:

@ tanqth hello can say detailed point? I don't quite understand

CodePudding user response:

Error message should be the client was disconnected by the server,
Based on: even in normal use for more than a year, can only use mobile hotspot,
Then demonstrate how mobile phones hot spot with the hot under network environment is different, and now the mobile phone hot network and normal use for a year of mobile phone hot spots may also have different network environment;
Then, you filezilla, set the passive mode; Since before use, hot, it can't use different aspects should be mainly in the network environment, should be mainly in the service mode can networking,

Finally, it is suggested that: 1, check if the server passive mode; 2, have a firewall blocking;

CodePudding user response:

1. Use the active or passive, is generally determined by the client, has nothing to do with the FTP server,
2. FTP browser using the active mode, you try set procedures to active mode (in fact is to transmit data when the client through the command channel provide client port number to the FTP server, the server to the client actively initiate connections, build a data transmission channel), FTP. Passive:=False; , and see if I can solve. Note that this requires the client Windows firewall to allow access,
3. If not yet, to switch to Serv -u FTP server test, see if there are any problems
  • Related