System.UnauthorizedAccessException

davearia

Centurion
Joined
Jan 4, 2005
Messages
184
Hi All,

I am trying to upload an image from my local machine to my remote server. Here is the most relavent code:
Visual Basic:
If (filePictureDialog.PostedFile.FileName.Length > 0) Then
            imageString = System.IO.Path.GetFileNameWithoutExtension(filePictureDialog.PostedFile.FileName)
            Try
                filePictureDialog.PostedFile.SaveAs(imageString)
                imgPigJaw.ImageUrl = imageString
            Catch ex As Exception
                txtAdditionalInformation.Text += ex.ToString
            End Try
End If
When I run this I get this message:
System.UnauthorizedAccessException: Access to the path "E:\WINDOWS\system32\jigsaw2" is denied.

I am lost as to what to do with this. I assume that I can alter my settings to give permissions on my machine that will allow the file to be uploaded. I need to get these images from anyone's machine who is using this ASP.NET page regardless of settings. I wouldn't say my security settings are that high and there is no firewall etc.

How do I get round this problem please?

Thanks, Dave. :D :D :D
 
Sorry,

I was running this locally on my machine (stupid I know).

When I run it on the server I get this message:
System.IO.DirectoryNotFoundException: Could not find a part of the path "c:\windows\system32\inetsrv\MasterPigJawSuzzle\WebJigsawVault\The_logo.gif".

My root directory htdocs has a folder bin which contains the dll of my ASP.NET program. In htdocs there is also a folder called MasterPigJawSuzzle in that is a folder called WebJigsawVault which is where I want to store the image into.

I hope this helps you in order to help me.

Thank, Dave.
 
Back
Top