Unfortunately, the path isn't going to do you any good at all. All you can
get is a file, not a directory. The upload control can only upload a single
file at a time because that's what the RFC for handling file upload on the
web specify. You can't access the filepath that exists on the user's machine
so that won't help since all you have access to is the file they select, and
some information about it.
To get around this would take an aweful lot of work as you would have to do
something drastic such as resort to WPF, a winform embedded in the browser,
or a custom browser add-in. None of these are really good solutions though
as they would be difficult and expensive to implement, not to mention would
probably annoy users if they had to do things such as download the .net
framework to run a winform.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
"K Viltersten" <tm**@viltersten.comwrote in message
news:op***************@lp028.pagero.local...
Den 2008-05-07 09:23:40 skrev K Viltersten <tm**@viltersten.com>:
>>I'd like to allow a user to point out a directory. There's facility for
pointing to a file, FileUpload, but there's nothing to get the path to
a given folder. How can that be solved (Silverlight is not an option).
Konrad Viltersten
In fact, as we're on the subject, when i get the information using
FileUploader.FileName
i only get the actual name and not the path. What i do need is the path,
acutally. The name itself is just an extra info. How can i get what i
need?
As i read my post i realize that someone will soon give me the (indeed
correct) information to use PostedFile.FileName. Is this the correct way
of obtaining the full path? Since no file has been uploaded on my system
(only a path has been obtained), i feel a future issues arise. Is it a
recommended way?
P.S.
Sorry for the scattered posting. Too much/little coffee, i say. :)
Konrad Viltersten