Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I read a file from my Local 'C' Drive??

Status
Not open for further replies.

DavidKnight

Programmer
Mar 31, 2004
27
CA
Hi All;

How do I read a file from my Local 'C' Drive??

The following code reads the Servers 'C' drive!

datagrid.DataSource = Directory.GetFiles("C:\")
datagrid.DataBind()

Thanks David
 
There are few things required...
Which platform are you using?
Reading files...means directory contents or file contents?
If file contents...Text files or Binary files?

Sharing the best from my side...

--Prashant--
 
The following code reads the Servers 'C' drive!
That's hardly surprising since the language you are using is Active Server Pages .NET! If you want to access the user's hard drive you are limited in what you can do. You can write an ActiveX component but this will only work if the users accepts the component and they are using Internet Explorer.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks to both responses..

To explain further I'm attempting to have the user copy their documents(Word, Excel, etc) from their local drives to a SQL2000 (server) DB table image.

I have it working but only from the WEB servers path.

Another question might be, How can I copy a users local file to the web server.

David
 
Use a file upload control


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks to both of you..

I just took a quick look at the "File Upload" and it looks good..

Davi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top