File Uploading tips in ASP.NET


Error: Access denied

It is very common experience to every developer when he/she host a file uploader page.  Interestingly developer does not face this error in development PC.

The main reason of this problem is security issue of the host computer. Host pc does not allow write operation of IU or Guest user. But IU and guest user need write access of upload folder in host pc.

the solution if not very standard considering security. follow the below steps,

1.  enable write access of virtual directory of the page using IIS(default value of write access is unchecked )

2. Right write click uploading folder of the site. In the security tab provide write access to Users, Internet Guest Account.

upload_share1

3. Complete

The main disadvantage of this technique is the security. Write access of IU user some time vulnerable. so, alternatively your can use database to store file instead of file system.

Thanks
Khayer
GIS Programmer, CEGIS
Bangladesh

Advertisements

One thought on “File Uploading tips in ASP.NET

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s