The default value of the dialog box is set by the browser. You can use javaScript to set the default directory. Please refer to this post about your question:
http://forums.asp.net/t/1273605.aspx
I forgot to mention that this is a web (asp.net) application
That really shouldnt need to be mentioned as all discussions at this site are for asp.net ;)
As for setting the path used by the browse button for a file upload, you cannot. As a security restriction, the fileupload path is read-only. If you could write to it, you could put hidden upload controls on a page and upload files without the users permission.
So the user must take specific action in their browser to pick the file/folder themsleves.
Mike Banavige
Marked as answer by Allen Li - MSFT on May 14, 2012 02:00 AM
SACSSP
Member
1 Points
16 Posts
How to set Default path to Fileupload brose button?
May 06, 2012 06:55 PM|LINK
I want to set default path to the browse button so that it will be easy to the user to go to the folder directly. Its a network path.
If there is a custom code please provide a link.
Thanks for your help.
hoopslife
Contributor
2477 Points
483 Posts
Re: How to set Default path to Fileupload brose button?
May 06, 2012 06:58 PM|LINK
Use RootFolder.
http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx
Blog
SACSSP
Member
1 Points
16 Posts
Re: How to set Default path to Fileupload brose button?
May 06, 2012 07:35 PM|LINK
Hi hoopslife,
Sorry I forgot to mention that this is a web (asp.net) application. Intranet application.
nikol3x
Member
46 Points
42 Posts
Re: How to set Default path to Fileupload brose button?
May 06, 2012 10:24 PM|LINK
Hello Saccsp,
The default value of the dialog box is set by the browser. You can use javaScript to set the default directory. Please refer to this post about your question: http://forums.asp.net/t/1273605.aspx
Thanks
mbanavige
All-Star
134949 Points
15415 Posts
ASPInsiders
Moderator
MVP
Re: How to set Default path to Fileupload brose button?
May 06, 2012 10:33 PM|LINK
That really shouldnt need to be mentioned as all discussions at this site are for asp.net ;)
As for setting the path used by the browse button for a file upload, you cannot. As a security restriction, the fileupload path is read-only. If you could write to it, you could put hidden upload controls on a page and upload files without the users permission.
So the user must take specific action in their browser to pick the file/folder themsleves.
hoopslife
Contributor
2477 Points
483 Posts
Re: How to set Default path to Fileupload brose button?
May 07, 2012 12:10 AM|LINK
My bad SACSSP. Like mbanavige said it should be obvious that all discussions on this site are for ASP.NET. lol
Blog