General Tech Bugs & Fixes . 6 hours ago

How to detect a file has been uploaded in the server and then trigger a function in PHP without CRON

How to detect a file has been uploaded in the server and then trigger a function in PHP without CRON

4 views   1   0 likes   1 shares Tuteehub forum manpreet 1 answers
tuteehub_quiz
Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

profilepic.png

Tuteehub forum answer Answers (1)


profilepic.png
manpreet Tuteehub forum best answer Best Answer 1 year ago

I have created a web application in PHP with an option for admin to upload a CSV file and submit the form and it will update/create new records in the database.

Now we have developed a system that will generate CSV file in the server every time when there is an update. Now the task is to detect if there is a new CSV file has been generated and trigger the form submit function and update the database, so everything will be automated.

I am already aware of using CRON jobs but I want to run my update script instantly and do not want CRON to run for every minutes or second.

I want to know if there is any way to detect the generated file, kind of event listener (RabbitMQ?) or something that will be triggered whenever a new file comes up in the server (LAMP Based).

Please give me some idea, how can I achieve this. CRON can do it job but it is not preferred for me.

Thanks in advance Sanny

4 views   1 shares
Related Tags