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

General Tech Bugs & Fixes 3 months ago

4 1 0 0 1 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 27 Jul 2024, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years 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

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.