Get directory name With browse

  • Thread starter Thread starter nicknack
  • Start date Start date
N

nicknack

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.
 
Hi,
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
 
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,
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
 
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,
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
 
nicknack said:
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.
 
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/udownload/webdemo/index.html
 
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 כתב:
 
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 ???:
 
Back
Top