Linux server cannot upload files to FTP server, Window uploads normally

Problem Description:

There is no problem with development and testing in the local Window environment, but when the application is deployed to the cloud server (Linux system), it is found that the file has not been uploaded, but the path for the file upload and storage can be generated, resulting in the inability to obtain the file analysis and storage

solution:

 

The function of the first line of the above two lines is as follows:
use commons-net-3.0.1jar in the project to download FTP files, it runs normally on windows xp or win10, but it can’t use the uploaded files normally when put on linux Interface and get file list interface. Therefore, it is necessary to call FTPClient.enterlocalPassiveMode() before calling the storeFile and IistFiles methods, which means that before each data connection, FTP clien tells the ftp server to open a port to transfer data. Why do you want to do this, because the ftp server may open different ports every time to transmit data, but on linux, due to security restrictions, some ports may not be opened, so there is blockage. 

Guess you like

Origin blog.csdn.net/bj_chengrong/article/details/101349869