Browse to Folder instead of Folder + File

D

Dan

I am working on a C# ASP.NET project where I need to allow the user to
browse to a folder. The only way I see how to do this is use <input
type=file>. But this makes the user select a file and returns folder
+ filename. I only want the folder path.

Does someone have a possible solution other than <input type=file>?
 
J

John Saunders

Dan said:
I am working on a C# ASP.NET project where I need to allow the user to
browse to a folder. The only way I see how to do this is use <input
type=file>. But this makes the user select a file and returns folder
+ filename. I only want the folder path.

Does someone have a possible solution other than <input type=file>?

What do you mean, "browse to a folder?" What would the user see when he got
there?
 
D

Dan

John Saunders said:
What do you mean, "browse to a folder?" What would the user see when he got
there?

When I use <input type=file> it allows the user to browse their hard
drive and return a path to the selected filename. I want to allow the
user to select a folder rather than file and return only the folder
path.
 
J

John Saunders

Dan said:
"John Saunders" <john.saunders at SurfControl.com> wrote in message

When I use <input type=file> it allows the user to browse their hard
drive and return a path to the selected filename. I want to allow the
user to select a folder rather than file and return only the folder
path.

<input type=file> doesn't just return the path, it returns the entire file.
 
D

Dan

John Saunders said:
<input type=file> doesn't just return the path, it returns the entire file.

Thanks John, but it actually returns both.

c:\blather\blah\bleep.txt

path = c:\blather\blah
file = bleep.txt.

<input type=file> will return path + file. Now that we have that
straightened out. I want something that returns ONLY path. And the
dialog box only allows the user to select a folder, not file.

I am using this so I can ask a user what folder has the files I want
to do things to.
 
J

John Saunders

Dan said:
"John Saunders" <john.saunders at SurfControl.com> wrote in message file.

Thanks John, but it actually returns both.

c:\blather\blah\bleep.txt

path = c:\blather\blah
file = bleep.txt.

<input type=file> will return path + file. Now that we have that
straightened out. I want something that returns ONLY path. And the
dialog box only allows the user to select a folder, not file.

I am using this so I can ask a user what folder has the files I want
to do things to.

I mean that it returns the FILE contents itself. I didn't mean that it
returns the file.typ part of a filespec.

See
http://msdn.microsoft.com/library/d...mwebuihtmlcontrolshtmlinputfileclasstopic.asp.
 
Joined
Oct 3, 2007
Messages
2
Reaction score
0
Browse to Folder instead of Folder + File Reply to Thread

Did you find a solution to this. I am working currently on a asp.net project where I need to get the folder name only and NOT FILE name....

Please let me know if you wer able to find a solution for this.

Shobha


Dan said:
"John Saunders" <john.saunders at SurfControl.com> wrote in message news:<#[email protected]>...
> "Dan" <[email protected]> wrote in message
> news:[email protected]...
> > "John Saunders" <john.saunders at SurfControl.com> wrote in message

> news:<#[email protected]>...
> > > "Dan" <[email protected]> wrote in message
> > > news:[email protected]...
> > > > I am working on a C# ASP.NET project where I need to allow the user to
> > > > browse to a folder. The only way I see how to do this is use <input
> > > > type=file>. But this makes the user select a file and returns folder
> > > > + filename. I only want the folder path.
> > > >
> > > > Does someone have a possible solution other than <input type=file>?
> > >
> > > What do you mean, "browse to a folder?" What would the user see when he

> got
> > > there?

> >
> > When I use <input type=file> it allows the user to browse their hard
> > drive and return a path to the selected filename. I want to allow the
> > user to select a folder rather than file and return only the folder
> > path.

>
> <input type=file> doesn't just return the path, it returns the entire file.


Thanks John, but it actually returns both.

c:\blather\blah\bleep.txt

path = c:\blather\blah
file = bleep.txt.

<input type=file> will return path + file. Now that we have that
straightened out. I want something that returns ONLY path. And the
dialog box only allows the user to select a folder, not file.

I am using this so I can ask a user what folder has the files I want
to do things to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top