views:

34

answers:

1

I'm trying to use the Bitmap class to save a file to a directory but it throws an error. Articles tell me that the directory does not have write permission. How do I set write permissions on the directory normally? I saw this answer but its talking about nant. I'm using regular asp.net mvc.

Apparently I cannot manually set write permission using the ftp as that option is disabled.

A: 

If you want your ASP.NET MVC site to write to a folder you need to make sure the IIS identity has write access to the folder where you want to write.

By default you should have access to the AppData folder (and anything underneath) but not to other folders so that if a hacker were to take control of your site the damage is limited to that folder.

Each hosting provider has a different tool to set the permissions for IIS. There should be an option for this where you created your virtual directory. Look for something like "Enable Write Permissions"

Hector
I store product images. Should I store this in app_data? can i have a direct url pointing to it?
Shawn Mclean
I wouldn't suggest having your product URLs point to an image on the AppData folder. In that case it might be better for you to create the image on a images folder and give your app write access to that folder. I am not sure how the godaddy control panel looks like to do that so I can't elaborate on it.
Hector