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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textreader help

Status
Not open for further replies.

dinger2121

Programmer
Sep 11, 2007
439
US
Hello,
I am building a web application (ASP.net) which is working with a textreader to get some data from a local text file.

I run the application from ide (locally) and everything works fine. When I publish the file to my server (server 2008 64-bit running iis7) and then run the application, I get a "Could not find a part of the path..." error.

I understand that this is some kind of permission issue, I just can't figure out how to solve it. I have tried adding mydomain\myserver$ as a read user in the application root, but to no avail. The application pool is running under the network service account which also has access to the application root.

Anyone have any thoughts about what I a missing?

Thanks

carl
MCSD, MCTS:MOSS
 
"Could not find a part of the path..." error - sounds more like a invalid filename/path. Write a trace on that page to verify the filename/path first.
 
Actually, the last part of the error is the actual path name that it can't find, and it is correct. It points to a location on the filesystem of the local machine that is accessing the web site.
I think it has something to do with the server account that the application is running under not having access to the local filesystem of the machine that is accessing the site.

carl
MCSD, MCTS:MOSS
 
I was able to solve this by saving the file back to the server so that it could access it -

savedFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Path.GetFileName(file.FileName));
file.SaveAs(savedFileName);

carl
MCSD, MCTS:MOSS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top