Question

I am trying to use jQuery FileTree to access a local shared folder. My code is below, which works absolutely fine if the folder has not been shared on the network. However, as soon as I share the folder, FileTree (or Javascript?) refuses to read it. This is on a Windows 2008 R2 Standard IIS Server (I know, we are bad people).

Is it possible for Javascript to access a local Shared folder? Keep in mind, I'm not trying to access a network share, but a local folder that has been shared. And it works perfectly fine, right up until the moment that I enable sharing.

I know there may be security vulnerabilities with allowing Javascript to access a shared folder, but this is for an Intranet application, so I'm not too concerned about that.

EDIT I heard back from the FileTree developers and they pointed out that if the PHP connector I am using can access the files, then FileTree will display it. So the issue is more likely with the PHP Connector. In that case, it should be possible to write a custom connector to accomplish this.

<script type="text/javascript">
$(document).ready( function() {
    $('#fileTreeDemo_1').fileTree({ root: '/quotes/', script: '/scripts/jqueryFileTree/connectors/jqueryFileTree.php' }, function(file) { 
    var parentId = <?php echo json_encode($_GET['id']); ?>;
    window.opener.updateValue(parentId, file);
    window.close();
    });
});
</script>

<div class="filebrowser_container">
    <div id="fileTreeDemo_1" class="filebrowser"></div>
</div>

Thanks so much for any help or advice.

Was it helpful?

Solution

Okay, so it wasn't Javascript or PHP, in this case. I simply had to make sure that the user that was being used to run the IIS process had enough permissions to be able to access network shares, and then I just added that user to the folder's list of shared users. Now everything works perfect!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top