Click here to Skip to main content
14,211,194 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi all :)

I have an upload control

and when I upload an image to pictures folder, i got this message


System.UnauthorizedAccessException was unhandled by user code
Message=Access to the path is denied.

what is the problem, and how can i solve it ?



thank you all :)
Posted
Comments
Sergey Alexandrovich Kryukov 23-Sep-11 19:33pm
   
You could provide some code sample. As you did not do it, my answer is based on my educated guess.
--SA
Rate this:
Please Sign up or sign in to vote.

Solution 1

It happens all the time. Remember, you cannot access any directories in the server's file systems beyond the root directory of your site. Also, your directory should provide right access to everyone. When you process post data on the server side, you need to calculate your directory where you write files relative to this root directory.

From the client point of view, all the path names of the directories should be relative to the page where the link is used. Alternatively they can be HTTP addresses having the addresses like http://subdomain.domain.tld mapped to the root directory of your site.

—SA
   
Comments
Simon Bang Terkildsen 23-Sep-11 19:35pm
   
my 5, though a quick google by the OP would have yielded tons of results
Sergey Alexandrovich Kryukov 23-Sep-11 19:38pm
   
True. Also, the proper way of saving file can be relatively easy found by combination of some experimenting and reading. Unfortunately, actual source of OP's problem is unknown, but most people do the same mistakes.
Thank you, Simon.
--SA
Rajesh Anuhya 11-Nov-11 2:19am
   
Good Answer +5,
@OP See my answer for the diff. permission on folders
   
Thank you, Rajesh.
--SA
Rate this:
Please Sign up or sign in to vote.

Solution 4

   
v2
Comments
   
1) First link is broken, 2) should not be in <pre>...</pre>
Please fix. I already voted 5 (in advance, though!) for the second links with is useful.
--SA
Rate this:
Please Sign up or sign in to vote.

Solution 3

You refer this site this may help you..

http://forums.digitalpoint.com/showthread.php?t=120863[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 5

go through the below link for folder permissions
http://support.microsoft.com/kb/308419[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190618.1 | Last Updated 11 Nov 2011
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100