Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi friends ,

Can anyone please tell me how to access a file located in LAN through ASP.NET.

I am displaying a data from Excel file in a gridview.
The Excel file when strored on same computer the application works fine.
but when the file from different location suppose
"\\10.91.86.152\Shared Folder" .

I am not able to access it.

Thank you very much for response.

Kishor
Posted
Updated 4-Mar-11 19:35pm
v3

Are you sure your application have write access to the location??
 
Share this answer
 
Comments
Debojyoti Majumder 5-Mar-11 5:03am    
Sorry for the mistake. I was talking about the "Read" access.
but when the file from different location suppose
"\\10.91.86.152\Shared Folder" .I am not able to access it.

It simply means you don't have the read access on the folder for the user.

To start with, make sure you are able to access the location normally using your windows-run command. If you are using some 'impersonation' in your web.config, then make sure that this username has access permissions. If no impersonation, then ASPNET should have the permission correctly configured.
 
Share this answer
 
You can try Server.MapPath(""); solve your problme.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900