473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

A very persistant Access To Path Denied Error


Hi Guys,

I'm stuck with a terribly persistant "Access to the path *** is denied"
problem. I'm trying to upload a foile using the file control. The code
checks if a file of the same name as uploaded exists and if so,
attempts to delete the file and then uploads the new file.

<STRONG>
Dim myFile As File

If myFile.Exists(Server.MapPath("..\photos\family\stu dent\"
& Session("ChildId") & ".jpg")) Then

myFile.Delete(Server.MapPath("..\photos\family\stu dent\" &
Session("ChildId") & ".jpg")) ' exception thrown here

End If
file1.PostedFile.SaveAs(Server.MapPath("..\photos\ family\student\" &
Session("ChildId") & ".jpg"))
</STRONG>

However I keep getting the following error "Access to path ** is
denied"

I've given ASP.NET all complete access to the folder where the file is
to be uploaded. I've even turned on impersonation in the webconfig file
and it still doesn't work. It makes no sense. I've tried everything an
still no luck. Any code snippets or suggetsions for this problem would
be highly appreciated.
--
paritycheck
Jul 21 '05 #1
1 1830
Is your settings in IIS set to "Enable parent paths" for that directory? You
can find this in the properties of your virtual directory on the Directory
tab > Click Configuration > and on the Options tab.

Cheers,
Steve

"paritycheck" wrote:

Hi Guys,

I'm stuck with a terribly persistant "Access to the path *** is denied"
problem. I'm trying to upload a foile using the file control. The code
checks if a file of the same name as uploaded exists and if so,
attempts to delete the file and then uploads the new file.

<STRONG>
Dim myFile As File

If myFile.Exists(Server.MapPath("..\photos\family\stu dent\"
& Session("ChildId") & ".jpg")) Then

myFile.Delete(Server.MapPath("..\photos\family\stu dent\" &
Session("ChildId") & ".jpg")) ' exception thrown here

End If
file1.PostedFile.SaveAs(Server.MapPath("..\photos\ family\student\" &
Session("ChildId") & ".jpg"))
</STRONG>

However I keep getting the following error "Access to path ** is
denied"

I've given ASP.NET all complete access to the folder where the file is
to be uploaded. I've even turned on impersonation in the webconfig file
and it still doesn't work. It makes no sense. I've tried everything an
still no luck. Any code snippets or suggetsions for this problem would
be highly appreciated.
--
paritycheck

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Theerachet Pratoommanee | last post by:
This is error message I've got. Any suggestion would be appreciated. Server Error in '/WebDirectory' Application. ----------------------------------------------------------------------------...
4
by: Fabian von Romberg | last post by:
Hi, I have installed Sql Reporting Services on 2 machines, one is WIN 2000 PRO and the other one is WIN 2000 ADV. SERVER. When I try to access a report using the webbrowser, I get the following...
0
by: Goran | last post by:
Hi I have created a very simple ASP.Net application that only consists of a CrystalReports Viewer, that has been connected to a .rpt file. When the page is loaded in the browser, the following...
3
by: Shailesh Humbad | last post by:
I figured out what was causing the "Access is Denied" error when calling functions from referenced DLLs in my service. I've tried to be very detailed, so bear with me. It turns out that...
1
by: paritycheck | last post by:
Hi Guys, I'm stuck with a terribly persistant "Access to the path *** is denied" problem. I'm trying to upload a foile using the file control. The code checks if a file of the same name as...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
1
by: cpajoe2001 | last post by:
I am having an issue and after searching around online for a day and half now and finding others with the same problem but yet no solution to my issue I am looking for help. What i have is ServerA...
8
by: Jeremy Ames | last post by:
I am trying to move an application from my system to a new test system. I really should have tried an easier program first, but I didn't really have a chance. My application was originally written in...
0
by: p.thorn.ru | last post by:
Hello, I am running db2 express-c 9.5 under linux (fedora 7), and my error log frequently shows messages like these: 2008-01-08-18.30.01.952964+180 I651334G1048 LEVEL: Error (OS) PID ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.