Browse Local Drives from Webpage

  • Thread starter Thread starter Wardeaux
  • Start date Start date
W

Wardeaux

Hey all,
need sample/article how to let user browse local drives to select a file
and have the local drive location returned so I can store it in my db,
similar to a file upload but without the actual file transfer and I need the
full path...
any assist is greatly appreciated!!
MTIA
wardeaux
 
You could just use a FileUpload control, but don't actually upload the file.
It should give you the full local path.
 
any suggestions on a good one?

Haacked said:
You could just use a FileUpload control, but don't actually upload the file.
It should give you the full local path.
 
You can use a HTML file input control.

<input id="inputfile" style="DISPLAY: none" type="file" name="browser"
runat="server">

Set it up to run at server.

Declare the control as part of page class.

protected System.Web.UI.HtmlControls.HtmlInputFile inputfile;

Then you can use the System.IO namespace to access the file system and the
Browser object to get the filename.

example: string extension =
System.IO.Path.GetExtension(Browser.PostedFile.FileName);

Enrique.
 
Back
Top