Browse Local Drives from Webpage

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
 
G

Guest

You could just use a FileUpload control, but don't actually upload the file.
It should give you the full local path.
 
W

Wardeaux

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.
 
E

Enrique Santa Cruz

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.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top