You can't access the file system directly from JavaScript because it's running on the client side. You would need to use AJAX to call a server side script file that does the actual file handling. I found a nice looking sample here that uses jQuery. It's pretty slick, I think I may hang onto this one too.
AJAX is not a necessity if you produce the entire tree structure and ship it to the browser for JS to take over. I've done it both ways, and used jQuery for each. The linked jQuery plugin above is the one I first used and it does use AJAX. I made heavy modifications to it to the point that it became an original work, then modified again to remove the need for AJAX calls.
I have had a major rethink of how Im going to have to do it, as the directory structure that appeared I wanted to be the users file system.
But I dont want to mess around with browser permissions or code signing or the like.
Thanks anyways - and for reference I was going to use extJS or YUI to do the hard qwork for me
Humm, in the Drupal world there is a module called IMCE which integrates with WYSIWYG's and allows for file browsing on the server. If it's a real important project, I'd download their code and see how they do what they do and mimic the sweetness.
I am trying to make a directory tree for a add-on Product for a OpenSource CMS I use as currently they are all flash or java based (for the CMS at least) and to make it nicer to use, I want to try and set it up as much as possible as a file system view.
I am no stranger to 3rd party JS libraries and am more than willing to use one (or more) to do this. I was looking at using extJS for the actual tree structure, but need to get contents of file system.
Any ideas?
Drogo