I m developing a website and Ineed to upload an image on server.My code for image upload is: FileUpload1.PostedFile.SaveAs(Server.MapPath("~/hotel image") + "\\" + fname); but when I upload image ,I am getting an Exception "The access of path Access to the path 'C:\Domains\thegrouphotel.com\wwwroot\testimg\b_mm_5.jpg' is denied. And I have set all permission to my folder on server 777 for all. pls help me
Usually you cannot set permissions for the Windows hosting like you are used to do that for the UNIX based systems. Therefore you should either ask your hosting company or check the control panel again and find whe feature about the writing permissions. Means all you need to set is a "Write permissions" for the directory you want to save/upload files in. But, remember you cannot use FTP Clients for that !
Thanks for your Response, but it won't helped me a lot. I consult the hosting provider too, but they too won't be able to resolve the problem. Even I searched the CP but did not get the feature.
what is the hosting company you use ? It is very possible that you deal with idiots support staff. Let me know which host you use and i will try to find solution for you.
From experience it's usually not the kind of thing you can control via CPANEL Hosting companies default permissions are not set the way you need them. if it's a shared hosting you need them to set up the appropriate permissions. if it's some kind of VPS you obviously need to do it Please note that some (rare) hosting will not ever set the appropriate permissions and then you are in trouble. again that's rare and if so they are usually some kind of idiots Good luck
It's definitely a permissions issue. The folder "testimg" needs to be assigned Write and possibly Modify (allowing overwriting and deleting) in IIS. Your control panel may not give you the ability to set these permissions, but if your host can't take care of that for you in a snap, then you need a new host!
no no you don't need to change your host necessary. There must be an option in the control panel that controls these things. I believe that it is best if you call support in this case. They will certainly give you an answer and help you to sort your problem out.