Access to the folder is denied

Access to the folder is denied

am 23.04.2008 21:46:25 von David C

I have a virtual folder on a web site that links to a shared folder on a 2nd
server. When I try to access it in my aspx page I get the following error:

Access to the path '\\server\photos\Hamelin, Jose\RO25201' is denied.

I gave the photos folder access from network service, anonymous, etc. and
still no luck. I even tried the "Connect as..." button in the IIS
properties but that did not work either.
Below is the aspx code and it fails on the GetFiles method. If I physically
type the file path into the browser, it displays the files in that folder.
Can anyone help? Thanks.

David

strFolderName = "Hamelin, Jose"
'Get information about the files in the specified folder
Dim virtualFolderPath As String = "Photos/" &
strFolderName.ToString & "/RO25201"
Dim folder As New
DirectoryInfo(Server.MapPath(virtualFolderPath))

Dim fileList As FileInfo() = folder.GetFiles("Initial*.jpg")
PicturesInFolder.DataSource = fileList
PicturesInFolder.DataBind()

Re: Access to the folder is denied

am 23.04.2008 23:45:19 von lexa

On Apr 23, 9:46=A0pm, "David C" wrote:
> I have a virtual folder on a web site that links to a shared folder on a 2=
nd
> server. =A0When I try to access it in my aspx page I get the following err=
or:
>
> Access to the path '\\server\photos\Hamelin, Jose\RO25201' is denied.
>
> I gave the photos folder access from network service, anonymous, etc. and
> still no luck. =A0I even tried the "Connect as..." button in the IIS
> properties but that did not work either.
> Below is the aspx code and it fails on the GetFiles method. =A0If I physic=
ally
> type the file path into the browser, it displays the files in that folder.=

> Can anyone help? =A0Thanks.
>
> David
>
> =A0 =A0 =A0 =A0 =A0 =A0 strFolderName =3D "Hamelin, Jose"
> =A0 =A0 =A0 =A0 =A0 =A0 'Get information about the files in the specified =
folder
> =A0 =A0 =A0 =A0 =A0 =A0 Dim virtualFolderPath As String =3D "Photos/" &
> strFolderName.ToString & "/RO25201"
> =A0 =A0 =A0 =A0 =A0 =A0 Dim folder As New
> DirectoryInfo(Server.MapPath(virtualFolderPath))
>
> =A0 =A0 =A0 =A0 =A0 =A0 Dim fileList As FileInfo() =3D folder.GetFiles("In=
itial*.jpg")
> =A0 =A0 =A0 =A0 =A0 =A0 PicturesInFolder.DataSource =3D fileList
> =A0 =A0 =A0 =A0 =A0 =A0 PicturesInFolder.DataBind()

http://groups.google.com/group/microsoft.public.dotnet.frame work.aspnet/brow=
se_thread/thread/ec9a28d4bb655c14/cf3ed675b1609854