Last post Apr 06, 2010 12:03 AM by akhilrajau
Apr 05, 2010 04:12 AM|Comotose|LINK
Hi all -- I hope this is an appropriate place to seek help with this problem.
I'll start off by trying to keep it as simple as possible, but please ask if more information required.
* I am a reseller for a major host, and as such I do not have direct access to the web server configuration, though the host technicians are fairly compliant with requests.
* Web server is Windows Server 2008/IIS7
* I use the DotNetPanel API to create new accounts (based on forms completed by a new customer) under my reseller account. I provide the DotNetPanel API with my reseller account login credentials, and this part works fine. New accounts are created just as required.
* Following the creation of the new account I then need to programmatically add a few folders to the new account. E.g. /images. This is where my problem starts.
MY .NET CODE (VB):
Here is the relevant snippet of my code:
Catch ex As Exception
Response.Write("Error Message = " & ex.Message & "<br>")
The result is always:
Access to the path 'C:\first-part-of-path-here\wwwroot\images\' is denied.
I then tried modifying the local web.config file with the addition of the following:
<identity impersonate="true" userName="Reseller-Username" password="Password" />
But then I get the following:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and
modify your configuration file appropriately.
Parser Error Message: Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown
user name or bad password.
Line 35: <system.web>
Line 37: <identity impersonate="true" userName="Reseller-Username" password="Password" />
Line 39: </system.web>
Source File: C:\blah\blah\blah\web.config Line: 37
If it is simply a matter of passing the right credentials in the application, it is not clear to me just what credentials are being requested and how they should
Since obviously I can create folders manually using DotNetPanel's File Manager or any FTP client, it seems to me I should be able to do the same thing programmatically.
Thank you for your assistance.
access to the path is denied
Apr 05, 2010 04:45 AM|renjithrajan88|LINK
once me too faced the same prob when i uploaded my web in the server.
at that time me too thought as u did that it may be some prob with the permission or some other. but the actual prob was with my code.
i didnt use the code properly. i mean the way i accessed the path location from the code behind.
Apr 05, 2010 04:51 AM|fashfaq|LINK
please make sure that u used server.mappath and please
give all the rights to that folder where u want to create folder or insert into the foler
Apr 06, 2010 12:01 AM|Comotose|LINK
Thanks very much to all for the input.
Hopefully this may better illustrate the problem I'm facing. I think you'll be able to see from the diagram why I'm running into permission problems -- but I can't figure out a way around it.
MY RESELLER ACCOUNT
+------ Customer Account: Main.com. This is the
| master membership website where a new member
| will complete a form. The DNP API uses that
| form info to create a new customer account
| (for example: Test-Domain.com). Main.com
| is the account that runs all the membership
| pages and code.
+------ New customer account: Test-Domain.com
Created by DNP API from Main.com above,
complete with website, FTP, e-mail accts, etc.
I encounter no problems creating new accounts.
+------ New folder: /Images. This folder
needs to be created programmatically
by Main.com after it creates the
new account, and this is the problem.
As you all know the ASP.NET code to create the folder is simple and I have proven it to work just fine:
However, *FROM* Main.com I have only managed to create a new folder *UNDER* Main.com.
So I guess the question comes down to:
what is the correct path parameter for the CreateDirectory command (run on Main.com), so as to create the new folder under the new customer account?
Using MapPath from the code in Main.com doesn't provide the physical path to Test-Domain.com, though I can figure out the correct path. But everything I try runs into (apparently) permission problems?
I believe this should be possible because obviously new folders can be created under any client account from a Reseller login.
Of course it would be really cool if the DNP API would allow the creation of folders at the same time a new account is created, but I don't think that's possible.
Apr 06, 2010 12:03 AM|akhilrajau|LINK
Please try after give permission for images folder to ASPNET account (NETWORKSERVICE if 2003)