When uploading a file, why upload it to the tomcat server first, and then from the tomcat server to the FTP server?

recently, I was looking at an open source project and found that when I found the file upload function, I would first set up a temporary folder in the tomcat server. The whole process is divided into three steps:

1. Upload the front-end files first stored in the tomcat server temporary folder
2.tomcat server temporary folder, and upload the files to the ftp server
3. Delete files under the tomcat snack folder

question: why upload it to the temporary folder of the tomcat server first? In the backend service business method, is it impossible to read the front-end stream directly and transfer it to the ftp server without writing it to the tomcat? Isn"t it superfluous to upload the file to tomcat before deleting it?

Jul.07,2021

  1. Tomcat should be able to write directly to the FTP server, probably because the open source component is not implemented.
  2. Tomcat can directly intercept the uploaded stream object, and then directly write to the FTP stream object without caching the file.
  3. the front end cannot be written directly to the FTP server without relying on plug-ins, because browsers only support HTTP, by default and do not support FTP protocol, unless the FTP server supports FTP protocol while supporting point-to-point HTTP upload interface

you have to communicate with tomocat. Ask him why?


you can also send js to oss

directly.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38686-2b95a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38686-2b95a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?