473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

UNC Path from Share Drive

Is there a way on a button press to create a browse for a file box and
then when they pick a file on a share drive to convert it to a UNC
path and that way I would save the unc path into a table and not have
to store the file? If anyone has a solution to getting the UNC path I
would love it. Please.

Feb 9 '07 #1
3 10024
On Feb 9, 2:49 pm, "wreed" <whr...@gmail.comwrote:
Is there a way on a button press to create a browse for a file box and
then when they pick a file on a share drive to convert it to a UNC
path and that way I would save the unc path into a table and not have
to store the file? If anyone has a solution to getting the UNC path I
would love it. Please.
I do this on our Intranet - and seeing as you are storing UNC paths
I can only assume this is also for your own intranet as internet
clients
won't be able to see the same LAN as internet servers.

This works on Windows IE 6 and 7 - basically use two input
elements, one a text input, the other a file input, then copy the
path from the file input to the text input when it changes.

You could make sure it is a UNC path on the way I suppose.
Note that the second input has no name attribute. This stops
the file contents being submitted with the form.

<form action="destination.page" method="post">
<input type="text" name="filepath" value="">
<input type="file" style="width:0px;" title="browse for file"
onchange="this.form.filepath.value = this.value;">
</form>

In firefox 2, the dummy file input element is not collapsed, so
you see two copies of the path. But we don't (yet) support firefox
on our intranet as we use a lot of activeX components to display
3D models.

Test it at http://www.chthonic.f9.co.uk/test/filebrowsetest.htm

Feb 9 '07 #2
How does this change it to a UNC path, all I see is once I browse the
Z:\whatever not the \\servername\blah.....

Am I missing something?

ne**@chthonic.f9.co.uk wrote:
On Feb 9, 2:49 pm, "wreed" <whr...@gmail.comwrote:
Is there a way on a button press to create a browse for a file box and
then when they pick a file on a share drive to convert it to a UNC
path and that way I would save the unc path into a table and not have
to store the file? If anyone has a solution to getting the UNC path I
would love it. Please.

I do this on our Intranet - and seeing as you are storing UNC paths
I can only assume this is also for your own intranet as internet
clients
won't be able to see the same LAN as internet servers.

This works on Windows IE 6 and 7 - basically use two input
elements, one a text input, the other a file input, then copy the
path from the file input to the text input when it changes.

You could make sure it is a UNC path on the way I suppose.
Note that the second input has no name attribute. This stops
the file contents being submitted with the form.

<form action="destination.page" method="post">
<input type="text" name="filepath" value="">
<input type="file" style="width:0px;" title="browse for file"
onchange="this.form.filepath.value = this.value;">
</form>

In firefox 2, the dummy file input element is not collapsed, so
you see two copies of the path. But we don't (yet) support firefox
on our intranet as we use a lot of activeX components to display
3D models.

Test it at http://www.chthonic.f9.co.uk/test/filebrowsetest.htm
Feb 9 '07 #3
On Feb 9, 6:08 pm, "wreed" <whr...@gmail.comwrote:
How does this change it to a UNC path, all I see is once I browse the
Z:\whatever not the \\servername\blah.....

Am I missing something?
Your users are selecting a mapped drive to get to the share?
Well, no wonder it doesn't work. I thought your problem
was how to get the path instead of the file itself, not how
to translate a local mapped-drive path into a UNC path

Solutions... 1) Get them to type the UNC path instead. OK,
it sounds flippant, but moving over to using, say, DFS to
manage your shared storage locations is hugely, hugely better
than using mapped drives.

2) on the server, get the mapped drive path, and use WMI
to query the client machine for a list of mapped drives,
lookup z: and substitute the UNC path. This will work if
the server-side code has enough privileges to do the query
and the client computer isn't so busy that it takes ages
to reply. You won't be able to do this client-side.
Feb 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Grant_S | last post by:
I need to identify the path to a users "My Document" folder where the user has a roaming profile and their "My Documents" folder is mapped to a network share as the H drive (specifically H:\\ -...
7
by: Eric.Jones | last post by:
I've encountered a strange error with loading delimited files from a Samba (SMB) network drive, has anyone else seen this before? (Platform: WinXP Pro, UDB PE 8015, level 02060106, SAMPLE db) ...
14
by: Gianfranco | last post by:
Hi everybody, First of all, sorry for my english if it isn't perfect ;-p I have an error in an asp.net application. I have win2003 server, with iis 6. I'm developping with visual studio...
1
by: Alex Stevens | last post by:
Hi All, I'm asking for opinion for the best way forward with storing the path of a network shared document in a SQL Server table. Essentially, I want to store in a part record the path to it's...
3
by: webgreginsf | last post by:
I'm attempting to use the FileSystemWatcher class to monitor a folder on a remote server. My app is running as a Windows service, currently on an XP machine, but it will be on Server 2003 in...
4
by: RLN | last post by:
Re: Access 2003/WinXP Pro-SP3 I have a shell command that does not run correctly. I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb Pgm1 launches Pgm2 via a command button...
0
by: jarmar | last post by:
We have a network share \\fileserver1\share that users have mapped individually/manually to any drive letter of there liking , not thru a login script. I have created a network share...
1
by: Billy | last post by:
Hi All, I'm attempting to use the MapNetworkDrive <snippedbelow from entire code below with very poor performance results. Basically, I have very small 73kb text files that are rewritten daily...
5
by: BigM | last post by:
Hi Guys, I am working up a little 'documents' section to an app of mine, where people can add links to docs on various share drives in our LAN, and they are displayed along with other details and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.