473,545 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get directory name With browse

Hello.
I would like to give my user an option to find a directory and choose
it.

Its just like the FileUpload control but the fileupload control choose
only files (if you choose a directory and press enter it open it and
not choose it).

is there a way to do it?

thanks.

Jan 21 '07 #1
7 2077
Hi,

nicknack wrote:
Hello.
I would like to give my user an option to find a directory and choose
it.

Its just like the FileUpload control but the fileupload control choose
only files (if you choose a directory and press enter it open it and
not choose it).

is there a way to do it?

thanks.
The HTML "file" control (which is what a FileUpload control eventually
gets rendered as) is very limited. Some limitations are for security
reasons. Some others are probably because it was never planned to use
the control for something else than upload files.

What I do to circumvent the limitation is ask the user to choose any
file in the target folder, and then use JavaScript to get the directory
name with a substring. It's not very comfortable, and I try to avoid it
as much as I can. But it's a workaround.

Maybe others have better ideas.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 21 '07 #2
OK, Thats a nice workaround.

As you said its not that comfortable but if i won't find any other way
- Its look like a nice solution.

Thanks.

Laurent Bugnion [MVP] כתב:
Hi,

nicknack wrote:
Hello.
I would like to give my user an option to find a directory and choose
it.

Its just like the FileUpload control but the fileupload control choose
only files (if you choose a directory and press enter it open it and
not choose it).

is there a way to do it?

thanks.

The HTML "file" control (which is what a FileUpload control eventually
gets rendered as) is very limited. Some limitations are for security
reasons. Some others are probably because it was never planned to use
the control for something else than upload files.

What I do to circumvent the limitation is ask the user to choose any
file in the target folder, and then use JavaScript to get the directory
name with a substring. It's not very comfortable, and I try to avoid it
as much as I can. But it's a workaround.

Maybe others have better ideas.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 21 '07 #3
OK, Thats a nice workaround.

As you said its not that comfortable but if i won't find any other way
- Its look like a nice solution.

Thanks.

Laurent Bugnion [MVP] כתב:
Hi,

nicknack wrote:
Hello.
I would like to give my user an option to find a directory and choose
it.

Its just like the FileUpload control but the fileupload control choose
only files (if you choose a directory and press enter it open it and
not choose it).

is there a way to do it?

thanks.

The HTML "file" control (which is what a FileUpload control eventually
gets rendered as) is very limited. Some limitations are for security
reasons. Some others are probably because it was never planned to use
the control for something else than upload files.

What I do to circumvent the limitation is ask the user to choose any
file in the target folder, and then use JavaScript to get the directory
name with a substring. It's not very comfortable, and I try to avoid it
as much as I can. But it's a workaround.

Maybe others have better ideas.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 21 '07 #4
nicknack wrote:
Hello.
I would like to give my user an option to find a directory and choose
it.

Its just like the FileUpload control but the fileupload control choose
only files (if you choose a directory and press enter it open it and
not choose it).

is there a way to do it?
In addition to Laurent's response, I want to remark that there's very
little you can do with a client directory, even if the user could select it.

There's no way to read the contents of that directory, or do anything
else with it, unless you use an ActiveX control or a Java applet.
In that case, you could incorporate the code to find the directory into
that control.

--

Riki
Jan 21 '07 #5
"Riki" <ri**@dontnagme .comwrote in message
news:ed******** ******@TK2MSFTN GP04.phx.gbl...
In addition to Laurent's response, I want to remark that there's very
little you can do with a client directory, even if the user could select
it.
Indeed.
There's no way to read the contents of that directory, or do anything
else with it, unless you use an ActiveX control or a Java applet.
That's also true.
In that case, you could incorporate the code to find the directory into
that control.
Quite so. I use this one:
http://www.utechsoft.com/products/ud...emo/index.html
Jan 21 '07 #6
Hi Riki,
..Thanks for your response

I just want to do a simple thing:
I have a lot of users in a network and there is a a share drive that
all user can see.
I want the option for one user to browse to one of the share directory
and add here name to the site.
Now, all the other users can see that link and click him to go to that
share directory.

So, I don't think I will need applet or Aactive directory.

Maybe no There is a better Idea?

Thanks again.
Riki כתב:
nicknack wrote:
Hello.
I would like to give my user an option to find a directory and choose
it.

Its just like the FileUpload control but the fileupload control choose
only files (if you choose a directory and press enter it open it and
not choose it).

is there a way to do it?

In addition to Laurent's response, I want to remark that there's very
little you can do with a client directory, even if the user could select it.

There's no way to read the contents of that directory, or do anything
else with it, unless you use an ActiveX control or a Java applet.
In that case, you could incorporate the code to find the directory into
that control.

--

Riki
Jan 21 '07 #7
"nicknack" <ro******@gmail .comwrote in message
news:11******** **************@ 38g2000cwa.goog legroups.com...
Hi Riki,
..Thanks for your response

I just want to do a simple thing:
I have a lot of users in a network and there is a a share drive that
all user can see.
I want the option for one user to browse to one of the share directory
and add here name to the site.
Now, all the other users can see that link and click him to go to that
share directory.

So, I don't think I will need applet or Aactive directory.

Maybe no There is a better Idea?

In that case, you should use some kind of file manager (server-side).
Plenty of free ones available. Search Google for "free ASP.NET file
manager".

--

Riki

Thanks again.
Riki ???:
nicknack wrote:
Hello.
I would like to give my user an option to find a directory and choose
it.

Its just like the FileUpload control but the fileupload control choose
only files (if you choose a directory and press enter it open it and
not choose it).

is there a way to do it?

In addition to Laurent's response, I want to remark that there's very
little you can do with a client directory, even if the user could select
it.

There's no way to read the contents of that directory, or do anything
else with it, unless you use an ActiveX control or a Java applet.
In that case, you could incorporate the code to find the directory into
that control.

--

Riki

Jan 22 '07 #8

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

Similar topics

2
7187
by: Sushil | last post by:
I'm looking for a way to select a directory from a local drive through a form (like input type="file" except I want to get a directory name not just a file). I've searched every way I could think of (refer to my brain comment above) and come up with absolutly nothing. Any ideas, help or pointers are appreciated. With Regards, Sushil...
4
12949
by: hamacher | last post by:
I have a particular need to an application . . . I need users to specify a directory (with path) on their filesystem on an HTML page. All I need at the server is a string representation of the path they choose. No file upload. No file names. Right now, I have users typing in full paths into an <input type="text"/> element. I would...
6
8885
by: Hemant Shah | last post by:
Folks, I need to move HOME directory of an instance to another directory. What is the best way of doing it? Is changing password file enough? or dies DB2 store this info in it's own config? I am running UDB 8.2 on Linux and AIX. Thanks.
39
2614
by: Joe Laughlin | last post by:
If I have a character array with "/some/file/directory/file_name", are there any functions / libraries that I could use to separate the directory ("some/file/directory") from the file name ("file_name"). I looked at sscanf(), but that didn't seem to do what I wanted. Thanks, Joe
2
14411
by: Jacky Luk | last post by:
Hi all, If I need to make a C# application, do I need to set up a virtual dir such as inetroot on the Harddisks. How do I set up such thingy? Thanks Jack
0
2079
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of security control Any feed back would be apreciated http://support.microsoft.com/default.aspx?scid=kb;EN-US;31795 FIX: "Failed to Start Monitoring Directory Changes" Error Message When You Browse...
2
1448
by: EO | last post by:
I'm using an ISP with poor tech support. I apologize if this is more of an ISP question, but it is an asp.net question as well. I have a root domain pointing to a root level folder. There are several folders in this root domain, each of which are aliased to other domain names. I used Visual Studio, through FP Extensions, logging in...
4
9076
by: lspoulin | last post by:
Hi, We have a webpage browsing folders within the wwwroot. We need to access a remote shared directory the same way. We created a virtual directory in IIS with an alias pointing on this remote directory. The virtual directory is accessible when we type it in the address bar of IE but when we try accessing it with a...
0
1180
by: desigeek | last post by:
I have an issue regarding wanting to put a Browse button on web page that will allow a user to select a directory path....not a file.....on their local machine. That selected directory path then would get populated into a text input field submission on a web form. The scenario involves asking a person during a web based registration process...
0
7470
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7811
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7760
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5334
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3455
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1019
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
709
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.