-------
I'm trying to store the full network path of a file in a shared directory network into a database, so that other users using the same database can call up this document from anywhere in the network.
for example
Mapped location on local system: L:\Subdirectory\Disaster.doc
Network location: \\NetworkFileServer\ITDATA\Disaster.doc
I have a form where the user browses the local file system to 'upload'. My aim is to get this location and map it to the corresponding network path location. Then store the network path in the database.
in this case, if a user decides to upload 'Disaster.doc' from his/her L: drive, the network location of the file i.e. "\\NetworkFileServer\ITDATA\Disaster.doc" is stored in the database.
How do I get this corresponding network location?
I'll be using JSP/Javascript, but dont hesitate to present solutions using anything else.
-------
I posted the above in the 'Software Dev' forum. There hasn't been any response. Extensive googling and MSDN-ing and caffeine intaking produced
http://www.winguides.com/scripting/r...php?category=3
and then i came up with the following code that did the trick ...
<HTML>
<HEAD>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
function displayNetworkShares() {
var WshNetwork = new ActiveXObject("WScript.Network");
var Drives = WshNetwork.EnumNetworkDrives()
var DriveInfo = new Array()
var j = 0
var content = "<h1>Drive Mapping List</h1>"
for (i = 0; i < Drives.length; i++) {
content += "<p>" + Drives.Item(i) + "</p>"
}
document.write(content)
}
</SCRIPT>
</HEAD>
<BODY>
<form>
<input type="Button" name="Button1" value="Give list" onClick="displayNetworkShares()">
</form>
</body>
</html>
sadly, this doesnt work in netscape, and i dont reckon its gonna work in browsers other than IE. please let me know if you notice any apparent errors or problems.
i'd really appreciate if people who have mapped network drives would please cut n paste this code and save it as a '.html' file, open it using IE, and let me know if they got the right mapping list.
also, is there ANYWAY of doing the same thing in Netscape/other browsers?