my web application need a database table from novell server to run, so i perform a drive mapping to connect to novell server ...and now the drive F:\appfolder\ which is from novell server are successfully connected to web server..
But problem arise, my web page comes out error 'Invalid path or file name' ..it cannot get connection F:\appfolder ....so i try to copy the data from F:\appfolder to C:\ ....and change the path in the web.config ....its working fine ...why is it the page
can get the connnection in C:\ but cannot get connection in network drive F:\appfolder ? i have check through the permission and it is a full control.....
And when i run in visual web developer, it can access network drive but using browser cannot access ..
.Any idea ? Below is the code of connection string in web.config...
The network drives are mapped by default using the current user credentials, these can be changed if required. I suggest to use the network path instead of mapped drives and importantly double check the permissions for ASPNET & IUsr account if anonymous
access is allowed.
i tried out using unc path but still same error invalid path , i seach through the website, they said web services or IIS are not able to read the network path unless we setup a .net secirity or using impersonation ...i have no idea on how to do with both
of these solutions...i can't find a step by step guidelines regarding these also ...
The network drives are mapped by default using the current user credentials, these can be changed if required. I suggest to use the network path instead of mapped drives and importantly double check the permissions for ASPNET & IUsr account if anonymous
access is allowed.
i am not familiar in security and access rights area, could u pls provide some detail guideline?
but i have created a new user called 'MYWEB' in the webserver, and this MYWEB user is belongs to Users group, but i don't know how to check the permision for ASPNET and IUsr account, can u pls guide me? i goto right click the web application folder,
under security, there's many users group in the box like administrators, networks, users , i give a full control to all these groups....but i just can't find ASPNET permission ...
oh.... then the problem is default aspnet account can not access network drive because of privilages on network drives.
Now about impersonation:
Add this in web.config under system.web section, if you are using Windows authentication to use the current logged in user credentials to access network drive or in general network resources:
oh.... then the problem is default aspnet account can not access network drive because of privilages on network drives.
Now about impersonation:
Add this in web.config under system.web section, if you are using Windows authentication to use the current logged in user credentials to access network drive or in general network resources:
htmlforums
Member
7 Points
84 Posts
invalid path in network drive
Jul 31, 2009 05:49 AM|LINK
my web application need a database table from novell server to run, so i perform a drive mapping to connect to novell server ...and now the drive F:\appfolder\ which is from novell server are successfully connected to web server..
But problem arise, my web page comes out error 'Invalid path or file name' ..it cannot get connection F:\appfolder ....so i try to copy the data from F:\appfolder to C:\ ....and change the path in the web.config ....its working fine ...why is it the page can get the connnection in C:\ but cannot get connection in network drive F:\appfolder ? i have check through the permission and it is a full control.....
And when i run in visual web developer, it can access network drive but using browser cannot access ..
.Any idea ? Below is the code of connection string in web.config...
<appSettings>
<add key="ConnectionString"
value="Provider=VFPOLEDB.1;Data Source=f:\\appfolder\\;" />
</appSettings>
This is my aspx page which error comes out at the con.open() :
string ConnStr = (string) ConfigurationSettings.AppSettings["ConnectionString"];
OleDbConnection con = new OleDbConnection(ConnStr);
con.Open();
Pls help! Thanks
bernhardkirc...
Member
268 Points
44 Posts
Re: invalid path in network drive
Jul 31, 2009 07:51 AM|LINK
Hello,
did you check the permissions of the user, that is running the site, configured in IIS?
Good luck,
Bernhard Kircher
arry.net
Member
624 Points
173 Posts
Re: invalid path in network drive
Jul 31, 2009 07:54 AM|LINK
<add name="ConnectionString"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MyProjectDB.mdf;Integrated Security=True;User Instance=True"/>
</connectionStrings>
SSA
Star
9370 Points
1577 Posts
Re: invalid path in network drive
Jul 31, 2009 07:58 AM|LINK
Problem is you need to get UNC path for f:\\ drive. Once you get actual network path, you can replace that in Connection string.
You can use WNetGetConnection function http://msdn.microsoft.com/en-us/library/aa385453(VS.85).aspx do get actual path from novel server for your f:\\ drive
or refer
Converting a mapped drive letter to a network path using C# here:
http://www.wiredprairie.us/blog/index.php/archives/22
Mak.Yadav
Member
14 Points
7 Posts
Re: invalid path in network drive
Jul 31, 2009 08:01 AM|LINK
The network drives are mapped by default using the current user credentials, these can be changed if required. I suggest to use the network path instead of mapped drives and importantly double check the permissions for ASPNET & IUsr account if anonymous access is allowed.
htmlforums
Member
7 Points
84 Posts
Re: invalid path in network drive
Aug 01, 2009 05:27 AM|LINK
i tried out using unc path but still same error invalid path , i seach through the website, they said web services or IIS are not able to read the network path unless we setup a .net secirity or using impersonation ...i have no idea on how to do with both of these solutions...i can't find a step by step guidelines regarding these also ...
htmlforums
Member
7 Points
84 Posts
Re: invalid path in network drive
Aug 01, 2009 05:47 AM|LINK
i am not familiar in security and access rights area, could u pls provide some detail guideline?
but i have created a new user called 'MYWEB' in the webserver, and this MYWEB user is belongs to Users group, but i don't know how to check the permision for ASPNET and IUsr account, can u pls guide me? i goto right click the web application folder, under security, there's many users group in the box like administrators, networks, users , i give a full control to all these groups....but i just can't find ASPNET permission ...
the IIS i use is version 6..
SSA
Star
9370 Points
1577 Posts
Re: invalid path in network drive
Aug 01, 2009 01:25 PM|LINK
oh.... then the problem is default aspnet account can not access network drive because of privilages on network drives.
Now about impersonation:
Add this in web.config under system.web section, if you are using Windows authentication to use the current logged in user credentials to access network drive or in general network resources:
<system.web>
<identity impersonate="true"/>
</system.web>
else Add this if you are using Forms authentication or To impersonate a specific user
<system.web>
<identity impersonate="true" userName="USERNAME" password="PASSWORD" />
</system.web>
This way asp.net will use mentioned user credentials to access network resources.
If you want to read in details go through:
http://support.microsoft.com/kb/306158
http://msdn.microsoft.com/en-us/library/xh507fc5(VS.71).aspx
http://www.west-wind.com/WebLog/posts/2153.aspx
Try this, may be this can solve your problem.
htmlforums
Member
7 Points
84 Posts
Re: invalid path in network drive
Aug 03, 2009 04:16 AM|LINK
i have included impersonte=true in web.config...same problem comes out ..
btw, how to make aspnet account able to access to network drive?
SSA
Star
9370 Points
1577 Posts
Re: invalid path in network drive
Aug 03, 2009 08:31 AM|LINK
I never did but
You can try :
http://weblogs.asp.net/mschwarz/archive/2003/03/31/4515.aspx