Asp mvc text editor
I am trying to use a text editor to extract data from a text file on my local machine. I have a download program to open the file for reading.
When I run the application locally, it works fine. When I publish my application to my server, I get the message "Failed to find part of the path error." I am guessing that this error is related to permission that the server cannot read from the local filesystem, but I do not know how to fix it correctly.
to set up an application to impersonate a user? I know that I cannot configure every local users machine to allow the iusr account to access it.
Thanks for any thoughts.
UPDATE **** I made sure the network service is the user for the application pool. I also ensured that the networkService has access to the local folder where the application resides. I am running IIS7 and when I test the site I get the error -
The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that <domain>\<computer_name>$ has Read access to the physical path. Then test these settings again
I've tried suggestions from various posts including adding the \ servername $ domain to a folder to allow access, but nothing seems to work.
Any thoughts?
a source to share
I solved this problem by first saving the file to the server and then accessing the local server file -
savedFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Path.GetFileName(file.FileName)); file.SaveAs(savedFileName);
The following blog helped me - http://www.hanselman.com/blog/default.aspx?date=2008-06-28
a source to share