473,382 Members | 1,441 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,382 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 1829
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 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?

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.