Last post Nov 19, 2010 12:57 PM by smiling4ever
Oct 28, 2006 01:11 PM|CSbeginner|LINK
i already build a website which have the option to upload to the
Server.MapPath and it is working perfect
now when am trying to do it on my current project, i get the UnauthorizedAccessException
very strange because am running it from my User account which is the Admin.
and i know that there is also the ASP.NET account, but i just can't find it. or find any way to authorize it full Access.
any advise on how can i get full authorized access, to my drive from ASP.NET will be appreciated
P.S i have WinXP home (no IIS) and am going to deploy it on a real server at the end.
Oct 29, 2006 10:09 AM|smiling4ever|LINK
It should be the ASPNET user with full permissions.
Try that and let me know.
Oct 29, 2006 10:36 AM|CSbeginner|LINK
i might be sound dumb, but i simply can't find any account ASPNET or ASP.NET, so i created those two as a "computer administrator" but still it is not working.
am doing it via the Control Panel > User Accounts, so that might be my mistake?
Oct 29, 2006 10:50 AM|smiling4ever|LINK
1) Right click on the folder you want to upload files into
2) Select properties
3) go to the security tab
4) Add the ASPNET user permissions
Oct 29, 2006 01:00 PM|CSbeginner|LINK
Ok i guess that am a special case (:
all i can find under the properties tab is General Sharing and
Customize i already try to allow and share that folder but nothing new. so if you got any idea what is so wrong with me, please say. otherwise thanks for the help so far.
Oct 29, 2006 05:23 PM|smiling4ever|LINK
You can get that tab which is disabled by default
Start | Control Panel | Folder Options | view tab | uncheck Use simple file sharing (Recommended)
Oct 29, 2006 11:17 PM|CSbeginner|LINK
Thank you so much. i really appreciate that.
anyway i guess that am just a lost case or something, so i hope that on the host server i will be able to do it.
Oct 30, 2006 07:40 AM|smiling4ever|LINK
In the hosting server, the hosting provider will do that for you.
Apr 24, 2010 04:55 AM|arunoyour|LINK
make sure that the same file doesn't already exist in the folder . if u r uploading a file with same file name .their is a chance for this error
Apr 26, 2010 01:10 AM|getvinay|LINK
The answer posted by smiling4ever is not the answer for all case.. check another possible answer posted above by arunoyour...
Nov 16, 2010 07:24 AM|robinspaul|LINK
I am in my office on office Network and I try to add ASPNET user to my folder.
I could not see ASPNET under 'security' tab of the folder properties.
So, I went to control panel and folder options. Under view I can see
use sharing wizard (Recommended)
I unchecked it. But, still I can't see ASPNET user.
Nov 16, 2010 04:47 PM|smiling4ever|LINK
Are you on Windows XP or 2003?
Try to add network service user privileges
Nov 16, 2010 04:55 PM|robinspaul|LINK
I am using Windows 7
Nov 17, 2010 04:28 AM|smiling4ever|LINK
What are the users in the security tab assigned to the folder/file you are trying to access ?
Nov 17, 2010 09:14 AM|robinspaul|LINK
My website is hosted on the IIS in my machine which is under my Office Network.
I have a page in the site where I have to upload files from my desktop.
When I upload a file in my directory on my desktop, I get the message - Access denied to C:\Users\myname\Desktop
I can see the names of all people under this network in my security tab. I added my name to the security tab. Still I get the error.
Nov 17, 2010 10:54 AM|smiling4ever|LINK
Have you tried to add "network service" with writing privileges?
Nov 17, 2010 11:52 AM|robinspaul|LINK
Yes, but no luck,
Nov 17, 2010 03:37 PM|smiling4ever|LINK
I think you will need to impersonate. Read this
Nov 19, 2010 01:54 AM|kctt|LINK
Network Service needs write permission on destination folder.
Just curious, you upload files from your desktop using a website hosted on your PC? This is only for testing website right?
What is the error when you choose files from different location. Say C: drive.
Nov 19, 2010 06:15 AM|robinspaul|LINK
I did impersonation. But, did not work.
I have give all permissions to Network Service in the destination folder.
When I upload the same file from C: drive it works. So, can it be a problem with the desktop?
Nov 19, 2010 12:57 PM|smiling4ever|LINK
Give your desktop folder the network service user with write permission and try again, it should work