Log in

View Full Version : Javascript Check For Folder Changes



M2com
09-17-2013, 03:57 AM
Hi,

I've searching for quite a while and all the search results are not very helpful and anything that seems remotely helpful (node.js) doesn't work. I am looking for a simple JS script that will just check every couple of seconds for a change in a specific folder (new files, deleted files, edited files, etc). If you guys could show me a great script or something I could easily build myself it would be most appreciated!

Thanks in advanced.

- M2com

jscheuer1
09-17-2013, 04:50 AM
Those functions are not available to javascript, period. If the folder is on the server, a server side language can do that and javascript could be used to ask a server side 'page' (in most cases a server side script really. Be it page or script, it would be written in a server side language* you're server is using) what the status of the folder is. If the server automatically supplies a directory listing files in folders without an index page in them and the folder you want doesn't have an index page, you could (theoretically at least) be able to simply fetch its contents and test it against the previously fetched directory listing's contents. If this is what you want to do and it's not such a folder, what server side language(s) do you have available? If it is such a folder, which one specifically?

If, on the other hand you want to check a folder on the local hard drive, there are ways to do that, but most, probably all, will raise security flags in the browser.


*Like PHP or ASP.NET