FTP传入监视器(上传时) [英] FTP incoming monitor (on upload)

查看:99
本文介绍了FTP传入监视器(上传时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有几百个用户通过FTP登录并上传文件。我们的在线系统(PHP)应该显示刚刚上传的项目。我不想继续检查所有不同的FTP文件夹来检查新文件。



什么是使用PHP检查新文件而不减慢速度的最佳方法服务器?所有用户在文件夹中都有文件,例如,/ uploads / user1,/ uploads / user2等。我想到的方法如下:


  • 不断检查上传文件夹以检查文件夹修改日期是否已更改(如果日期已从上次更改,文件已进入)。可以使用什么PHP函数来检查上传目录上次修改的日期/时间?

  • 如果修改上述日期已更改,请使用scandir()遍历每个目录更改为拾取目录识别文件。

    解决方案

    在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆