If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Javascript Check For Folder Changes

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!

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

Last edited by jscheuer1; 09-17-2013 at 08:24 AM.
Reason: detail/punctuation