P
paritycheck
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\student\"
& Session("ChildId") & ".jpg")) Then
myFile.Delete(Server.MapPath("..\photos\family\student\" &
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.
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\student\"
& Session("ChildId") & ".jpg")) Then
myFile.Delete(Server.MapPath("..\photos\family\student\" &
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.