Last post Jun 13, 2008 03:37 AM by Vince Xu - MSFT
Jun 10, 2008 10:02 PM|dwfreeman|LINK
Is there a way to establish a default folder for the Fileupload control?
Jun 10, 2008 10:08 PM|vinz|LINK
You need to set the location during uploading the files using the SaveAs method
Jun 10, 2008 10:33 PM|dwfreeman|LINK
Actually, what I meant was to have the Browse button open explorer to a specific folder. Not necessarilly to the last one visited.
Jun 11, 2008 01:46 AM|cdoloriert|LINK
Check this link and take a look at the code sample and you will find out how to set the path for that control.
Hope this helps
Jun 11, 2008 04:26 PM|dwfreeman|LINK
I must be missing it. The only line in the sample that involves a path is
Dim savePath As
String = "c:\temp\uploads\"
Changeing that value does not impact the file search folder.
Jun 11, 2008 04:35 PM|Pandiya|LINK
By default, the requireRootedSaveAsPath attribute of the httpRuntime configuration element in the Web.config file is set to true, which means that
you need to provide an absolute path to save the file.
Jun 11, 2008 04:43 PM|kraznodar|LINK
You are wanting to control the directory location that the browse starts in and not the save path the file is uploaded to, correct?
I could be wrong but since the server never knows the file structure of the client machine, the developers of that control probably did not provide for that functionality.
Jun 11, 2008 07:37 PM|dwfreeman|LINK
You are correct. I think you are the first person who understands the question. And you may be correct that it can't be done.
Jun 13, 2008 03:37 AM|Vince Xu - MSFT|LINK
I'm agreed with the above. The dufault value is due to the browser. FileUpload.Value can return the path on the client, but it is read only.
It refers to some security problem, so you had better give it up.
Hope it helps.