R
rn5a
I have a ASPX page which has a ListBox & a Button. The ListBox lists
all the files & directories existing in a directory on the server. I
want to give users the option to download files from the server.
When a user selects a file from the ListBox & clicks the button to
download the selected file, I am getting the following error:
Access to the path 'c:\inetpub\wwwroot\Folder1\MyDir' is denied.
The directories & files that the ListBox lists reside in the 'MyDir'
directory. This is the OnClick event function of the button:
<%@ Import Namespace="System.Net" %>
Sub DwnldFile(obj As Object, ea As EventArgs)
Dim strFileName As String
Dim wClient As New WebClient
strFileName = Request.Form("lstFD")
wClient.DownloadFile(Server.MapPath("Folder1\MyDir"), strFileName)
End Sub
I have gone through a no. of posts to resolve this issue but haven't
had any luck so far.
Can someone please tell me where I could be going wrong?
all the files & directories existing in a directory on the server. I
want to give users the option to download files from the server.
When a user selects a file from the ListBox & clicks the button to
download the selected file, I am getting the following error:
Access to the path 'c:\inetpub\wwwroot\Folder1\MyDir' is denied.
The directories & files that the ListBox lists reside in the 'MyDir'
directory. This is the OnClick event function of the button:
<%@ Import Namespace="System.Net" %>
Sub DwnldFile(obj As Object, ea As EventArgs)
Dim strFileName As String
Dim wClient As New WebClient
strFileName = Request.Form("lstFD")
wClient.DownloadFile(Server.MapPath("Folder1\MyDir"), strFileName)
End Sub
I have gone through a no. of posts to resolve this issue but haven't
had any luck so far.
Can someone please tell me where I could be going wrong?