0

I am trying to set up the following interface between websites:
1) Other websites will upload (xml) files on my webserver via FTP on a specific folder
2) My website will scan the folder for new files and will import them immediately after they have been uploaded
2a) Ideally the scan is triggered after a new file is uploaded in FTP, but I do not know how to do this. Is this possible?
2b) Alternatively, I use cron to scan the folder every second, but I think this will use a lot of resources.
3) After the (xml) file has been detected, it will be automatically imported in the mySQL database.

I just cant find any help on using the scan for new file trigger. I am using PHP, PHP my admin and Drupal. Are these tools sufficient or should I have something else?

  • Why do you need to scan every second? Isn't every X minutes sufficient? – tadman Apr 30 '13 at 19:27
  • Is FTP absolutely necessary? It will be much easier to handle "seamless" integration between the two websites implementing some kind of webservice. – herrjeh42 Apr 30 '13 at 20:21
  • @tadman: I want to have the interface as seamless as possible, when an XML message has been uploaded, the user can immediately view the results in the website. The term I was looking for was hotfolder. I found a drupal module that should handle this but I have yet to implement it (http://drupal.org/project/hotfolder). – user1007717 Apr 30 '13 at 20:25
  • @jamie0726 I am not the owner of the other websites so I do not think that a seamless integration is possible. – user1007717 Apr 30 '13 at 20:28
  • check out this posting on options how to monitor a directory with php http://stackoverflow.com/questions/540339/how-to-check-if-directory-contents-has-changed-with-php – herrjeh42 Apr 30 '13 at 20:33

1 Answers1

0

You could rather user their feeds and import and update will be done at every cron runs!

Bhavin Joshi
  • 514
  • 3
  • 12