Click here to Skip to main content
16,004,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,


I created a folder in the root directory of my application through the code and uploaded images to it...it worked in local system...when the application hosted in a server the directory is getting created and when trying to up images it shows error "Access Denied".It means do not have write permission ...How can i do it programatically...
Plz help me...

All Suggestions are welcome
Thanks in Advance
Posted
Comments
ZurdoDev 15-Mar-12 10:48am    
But you don't have permissions, so how is code going to get around permissions? You either need to run code with permissions or have your hoster change permissions for you.

1 solution

I dont have any exprience with servers however if it is C# I will recommend you to have a look on these APIs

http://msdn.microsoft.com/en-us/library/system.io.directory.aspx
http://msdn.microsoft.com/en-us/library/system.io.directory.setaccesscontrol.aspx

Also if your code hasn't got that much of access then you can try taking token for some higher privileged account.(But I dont know its side effects)
http://msdn.microsoft.com/en-us/library/windows/desktop/aa374909(v=vs.85).aspx
 
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