FTP传入监视器(上传时) [英] FTP incoming monitor (on upload)
问题描述
我们有几百个用户通过FTP登录并上传文件。我们的在线系统(PHP)应该显示刚刚上传的项目。我不想继续检查所有不同的FTP文件夹来检查新文件。
什么是使用PHP检查新文件而不减慢速度的最佳方法服务器?所有用户在文件夹中都有文件,例如,/ uploads / user1,/ uploads / user2等。我想到的方法如下:
在FTP服务器中启用日志记录,并解析日志,通常是/ var / log / xferlog。 FTP服务器通常使用像这个。
We have a few 100 users logging in via FTP and uploading files. Our online system (PHP) should display items that have just been uploaded. I don't want to keep checking all the different FTP folders to check for new files.
What is the best way to check for new files with PHP without slowing down the server? All the users have files in folders for example, /uploads/user1, /uploads/user2, etc. The approach I have in mind is the following:
- Constantly check uploads folder to check if the folder modification date has changed (if the date has changed from last time, a file has come in). What PHP function can I use to check upload directory last modified date/time?
- If above date modified has changed, Use scandir() to go through each directory to pickup directory that has changed to identify files.
Enable logging in your FTP server, and parse the log, usually /var/log/xferlog . FTP servers usually use a format like this.
这篇关于FTP传入监视器(上传时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!