Click here to Skip to main content
15,917,174 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello everyone,
I am creating a date-wise folder dynamically using code, now I want to grant permission to it so that i can upload images in it......
plz suggest me....
Posted
Comments
Sergey Alexandrovich Kryukov 22-Nov-12 2:50am    
Where? On server or client side? Why?
--SA
Gopal Rakhal 22-Nov-12 4:28am    
when i upload images it gives "Access to the path 'D:\inetpub\vhosts\.....(url)\httpdocs\22-11-2012' is denied."
Sergey Alexandrovich Kryukov 22-Nov-12 4:46am    
Please answer my question. Server side?
--SA
Gopal Rakhal 24-Nov-12 2:00am    
yes.....
Sergey Alexandrovich Kryukov 24-Nov-12 18:52pm    
Are you trying to create sub-directory under the root directory of the site, or outside it?
--SA

1 solution

I discussed the location in the comments to the question because I was afraid about one very usual mistake: trying to access file system objects outside the root directory of the site on server side. Still, you need to check up if the location is correct and you correctly calculate it. You need to use System.Web.HttpServerUtility.MapPath: http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx[^].

If you really need to address file/directory permission, please see:
http://msdn.microsoft.com/en-us/library/5ba4k1c5.aspx[^],
http://msdn.microsoft.com/en-us/library/system.security.permissions.fileiopermission.aspx[^].

—SA
 
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