Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

watch local directory for new files in javascript/html5

as title says, is it possible to monitor a local dir in the real filesystem (not html5 sandbox)? I'd like to write an automatic photo uploader that looks for new photos and uploads them.

like image 495
luca Avatar asked Nov 24 '22 07:11

luca


1 Answers

Potential repeat of Local file access with Javascript.

My understanding is that you can't access the local filesystem directly through a web browser, you have to use an intermediary like the form input tag or drag and drop.

You may be able to get away with accessing the filesystem if you were to use the operating system's javascript interpreter or something like V8. There may also be experimental javascript api's in Chrome that you could look for on the Chrome flags page if thats your browser of choice. That all depends on whether or not you were doing a personal project or something for the web.

Otherwise another scripting language such as PHP, Ruby, or Python would better suit your needs.

like image 53
Goldfish Sandwich Avatar answered Nov 26 '22 21:11

Goldfish Sandwich